| java.lang.Object org.cyberneko.html.filters.DefaultFilter org.cyberneko.html.filters.Writer
Writer | public class Writer extends DefaultFilter (Code) | | An HTML writer written as a filter. Besides serializing the HTML
event stream, the writer also passes the document events to the next
stage in the pipeline. This allows applications to insert writer
filters between other custom filters for debugging purposes.
Since an HTML document may have specified its encoding using the
<META> tag and http-equiv/content attributes, the writer will
automatically change any character set specified in this tag to
match the encoding of the output stream. Therefore, the character
encoding name used to construct the writer should be an official
IANA
encoding name and not a Java encoding name.
Note:
The modified character set in the <META> tag is not
propagated to the next stage in the pipeline. The changed value is
only output to the stream; the original value is sent to the next
stage in the pipeline.
author: Andy Clark version: $Id: Writer.java,v 1.7 2005/02/14 04:01:33 andyc Exp $ |
Constructor Summary | |
public | Writer() Constructs a writer filter that prints to standard out. | public | Writer(OutputStream outputStream, String encoding) Constructs a writer filter using the specified output stream and
encoding.
Parameters: outputStream - The output stream to write to. Parameters: encoding - The encoding to be used for the output. | public | Writer(java.io.Writer writer, String encoding) Constructs a writer filter using the specified Java writer and
encoding.
Parameters: writer - The Java writer to write to. Parameters: encoding - The encoding to be used for the output. |
Method Summary | |
public void | characters(XMLString text, Augmentations augs) Characters. | public void | comment(XMLString text, Augmentations augs) Comment. | public void | emptyElement(QName element, XMLAttributes attributes, Augmentations augs) Empty element. | public void | endElement(QName element, Augmentations augs) End element. | public void | endGeneralEntity(String name, Augmentations augs) End general entity. | public static void | main(String[] argv) Main. | protected void | printAttributeValue(String text) Print attribute value. | protected void | printCharacters(XMLString text, boolean normalize) Print characters. | protected void | printEndElement(QName element) Print end element. | protected void | printEntity(String name) Print entity. | protected void | printStartElement(QName element, XMLAttributes attributes) Print start element. | public void | startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) Start document. | public void | startDocument(XMLLocator locator, String encoding, Augmentations augs) Start document. | public void | startElement(QName element, XMLAttributes attributes, Augmentations augs) Start element. | public void | startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) Start general entity. |
AUGMENTATIONS | final protected static String AUGMENTATIONS(Code) | | Augmentations feature identifier.
|
FILTERS | final protected static String FILTERS(Code) | | Filters property identifier.
|
NOTIFY_CHAR_REFS | final public static String NOTIFY_CHAR_REFS(Code) | | Notify character entity references.
|
NOTIFY_HTML_BUILTIN_REFS | final public static String NOTIFY_HTML_BUILTIN_REFS(Code) | | Notify built-in entity references.
|
fElementDepth | protected int fElementDepth(Code) | | Element depth.
|
fNormalize | protected boolean fNormalize(Code) | | Normalize character content.
|
fPrintChars | protected boolean fPrintChars(Code) | | Print characters.
|
fPrinter | protected PrintWriter fPrinter(Code) | | The print writer used for serializing the document with the
appropriate character encoding.
|
fSeenHttpEquiv | protected boolean fSeenHttpEquiv(Code) | | Seen http-equiv directive.
|
fSeenRootElement | protected boolean fSeenRootElement(Code) | | Seen root element.
|
Writer | public Writer()(Code) | | Constructs a writer filter that prints to standard out.
|
Writer | public Writer(OutputStream outputStream, String encoding) throws UnsupportedEncodingException(Code) | | Constructs a writer filter using the specified output stream and
encoding.
Parameters: outputStream - The output stream to write to. Parameters: encoding - The encoding to be used for the output. The encoding nameshould be an official IANA encoding name. |
Writer | public Writer(java.io.Writer writer, String encoding)(Code) | | Constructs a writer filter using the specified Java writer and
encoding.
Parameters: writer - The Java writer to write to. Parameters: encoding - The encoding to be used for the output. The encoding nameshould be an official IANA encoding name. |
characters | public void characters(XMLString text, Augmentations augs) throws XNIException(Code) | | Characters.
|
comment | public void comment(XMLString text, Augmentations augs) throws XNIException(Code) | | Comment.
|
emptyElement | public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code) | | Empty element.
|
endElement | public void endElement(QName element, Augmentations augs) throws XNIException(Code) | | End element.
|
endGeneralEntity | public void endGeneralEntity(String name, Augmentations augs) throws XNIException(Code) | | End general entity.
|
printAttributeValue | protected void printAttributeValue(String text)(Code) | | Print attribute value.
|
printCharacters | protected void printCharacters(XMLString text, boolean normalize)(Code) | | Print characters.
|
printEndElement | protected void printEndElement(QName element)(Code) | | Print end element.
|
printEntity | protected void printEntity(String name)(Code) | | Print entity.
|
printStartElement | protected void printStartElement(QName element, XMLAttributes attributes)(Code) | | Print start element.
|
startDocument | public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException(Code) | | Start document.
|
startDocument | public void startDocument(XMLLocator locator, String encoding, Augmentations augs) throws XNIException(Code) | | Start document.
|
startElement | public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code) | | Start element.
|
startGeneralEntity | public void startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) throws XNIException(Code) | | Start general entity.
|
Fields inherited from org.cyberneko.html.filters.DefaultFilter | protected XMLDocumentHandler fDocumentHandler(Code)(Java Doc) protected XMLDocumentSource fDocumentSource(Code)(Java Doc)
|
Methods inherited from org.cyberneko.html.filters.DefaultFilter | public void characters(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc) public void comment(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc) public void doctypeDecl(String root, String publicId, String systemId, Augmentations augs) throws XNIException(Code)(Java Doc) public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)(Java Doc) public void endCDATA(Augmentations augs) throws XNIException(Code)(Java Doc) public void endDocument(Augmentations augs) throws XNIException(Code)(Java Doc) public void endElement(QName element, Augmentations augs) throws XNIException(Code)(Java Doc) public void endGeneralEntity(String name, Augmentations augs) throws XNIException(Code)(Java Doc) public void endPrefixMapping(String prefix, Augmentations augs) throws XNIException(Code)(Java Doc) public XMLDocumentHandler getDocumentHandler()(Code)(Java Doc) public XMLDocumentSource getDocumentSource()(Code)(Java Doc) public Boolean getFeatureDefault(String featureId)(Code)(Java Doc) public Object getPropertyDefault(String propertyId)(Code)(Java Doc) public String[] getRecognizedFeatures()(Code)(Java Doc) public String[] getRecognizedProperties()(Code)(Java Doc) public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc) protected static String[] merge(String[] array1, String[] array2)(Code)(Java Doc) public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException(Code)(Java Doc) public void reset(XMLComponentManager componentManager) throws XMLConfigurationException(Code)(Java Doc) public void setDocumentHandler(XMLDocumentHandler handler)(Code)(Java Doc) public void setDocumentSource(XMLDocumentSource source)(Code)(Java Doc) public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code)(Java Doc) public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)(Java Doc) public void startCDATA(Augmentations augs) throws XNIException(Code)(Java Doc) public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException(Code)(Java Doc) public void startDocument(XMLLocator locator, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)(Java Doc) public void startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri, Augmentations augs) throws XNIException(Code)(Java Doc) public void textDecl(String version, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException(Code)(Java Doc)
|
|
|