org.cyberneko.html.filters
public class Writer extends DefaultFilter
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.
Version: $Id: Writer.java,v 1.7 2005/02/14 04:01:33 andyc Exp $
Field Summary | |
---|---|
protected static String | AUGMENTATIONS Augmentations feature identifier. |
protected int | fElementDepth Element depth. |
protected String | fEncoding The encoding. |
protected boolean | fNormalize Normalize character content. |
protected boolean | fPrintChars Print characters. |
protected PrintWriter | fPrinter
The print writer used for serializing the document with the
appropriate character encoding. |
protected boolean | fSeenHttpEquiv Seen http-equiv directive. |
protected boolean | fSeenRootElement Seen root element. |
protected static String | FILTERS Filters property identifier. |
static String | NOTIFY_CHAR_REFS Notify character entity references. |
static String | NOTIFY_HTML_BUILTIN_REFS Notify built-in entity references. |
Constructor Summary | |
---|---|
Writer() Constructs a writer filter that prints to standard out. | |
Writer(OutputStream outputStream, String encoding)
Constructs a writer filter using the specified output stream and
encoding.
| |
Writer(Writer writer, String encoding)
Constructs a writer filter using the specified Java writer and
encoding.
|
Method Summary | |
---|---|
void | characters(XMLString text, Augmentations augs) Characters. |
void | comment(XMLString text, Augmentations augs) Comment. |
void | emptyElement(QName element, XMLAttributes attributes, Augmentations augs) Empty element. |
void | endElement(QName element, Augmentations augs) End element. |
void | endGeneralEntity(String name, Augmentations augs) End general entity. |
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. |
void | startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) Start document. |
void | startDocument(XMLLocator locator, String encoding, Augmentations augs) Start document. |
void | startElement(QName element, XMLAttributes attributes, Augmentations augs) Start element. |
void | startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) Start general entity. |
Parameters: outputStream The output stream to write to. encoding The encoding to be used for the output. The encoding name should be an official IANA encoding name.
Parameters: writer The Java writer to write to. encoding The encoding to be used for the output. The encoding name should be an official IANA encoding name.