| java.lang.Object org.apache.xml.serializer.SerializerBase org.apache.xml.serializer.ToStream org.apache.xml.serializer.ToHTMLStream
ToHTMLStream | final public class ToHTMLStream extends ToStream (Code) | | This serializer takes a series of SAX or
SAX-like events and writes its output
to the given stream.
This class is not a public API, it is public
because it is used from another package.
|
Inner Class :static class Trie | |
Field Summary | |
final static Trie | m_elementFlags A digital search trie for fast, case insensitive lookup of ElemDesc objects. | protected boolean | m_inDTD |
Constructor Summary | |
public | ToHTMLStream() Default constructor. |
Method Summary | |
public void | addUniqueAttribute(String name, String value, int flags) This method is used to add an attribute to the currently open element. | public void | attributeDecl(String eName, String aName, String type, String valueDefault, String value) This method does nothing. | final public void | cdata(char ch, int start, int length) Receive notification of cdata.
The Parser will call this method to report each chunk of
character data. | final public void | characters(char chars, int start, int length) Receive notification of character data.
The Parser will call this method to report each chunk of
character data. | protected void | closeStartTag() | public void | comment(char ch, int start, int length) | public void | elementDecl(String name, String model) This method does nothing. | public void | endDTD() Report the end of DTD declarations. | final public void | endDocument() Receive notification of the end of a document. | final public void | endElement(String namespaceURI, String localName, String name) Receive notification of the end of an element. | final public void | endElement(String elemName) | final public void | entityReference(String name) Receive notivication of a entityReference. | public void | externalEntityDecl(String name, String publicId, String systemId) This method does nothing. | final public static ElemDesc | getElemDesc(String name) Get a description of the given element.
Parameters: name - non-null name of element, case insensitive. | protected synchronized void | init(OutputStream output, Properties format) Initialize the serializer with the specified output stream and output
format. | static void | initTagReference(Trie m_elementFlags) | public void | internalEntityDecl(String name, String value) This method does nothing. | public void | namespaceAfterStartElement(String prefix, String uri) This method is used when a prefix/uri namespace mapping
is indicated after the element was started with a
startElement() and before and endElement(). | protected void | processAttribute(java.io.Writer writer, String name, String value, ElemDesc elemDesc) Process an attribute. | public void | processAttributes(java.io.Writer writer, int nAttrs) Process the attributes, which means to write out the currently
collected attributes to the writer. | public void | processingInstruction(String target, String data) Receive notification of a processing instruction. | public boolean | reset() | public void | setOmitMetaTag(boolean bool) Tells if the formatter should omit the META tag. | public void | setOutputFormat(Properties format) Specifies an output format for this serializer. | public void | setOutputStream(OutputStream output) Specifies an output stream to which the document should be
serialized. | public void | setSpecialEscapeURLs(boolean bool) Tells if the formatter should use special URL escaping. | public void | startDTD(String name, String publicId, String systemId) | protected void | startDocumentInternal() Receive notification of the beginning of a document. | public void | startElement(String namespaceURI, String localName, String name, Attributes atts) Receive notification of the beginning of an element. | public void | writeAttrString(java.io.Writer writer, String string, String encoding) Writes the specified string after substituting specials,
and UTF-16 surrogates for character references &#xnn . | public void | writeAttrURI(java.io.Writer writer, String string, boolean doURLEscaping) Write the specified string after substituting non ASCII characters,
with %HH , where HH is the hex of the byte value. |
m_elementFlags | final static Trie m_elementFlags(Code) | | A digital search trie for fast, case insensitive lookup of ElemDesc objects.
|
m_inDTD | protected boolean m_inDTD(Code) | | This flag is set while receiving events from the DTD
|
ToHTMLStream | public ToHTMLStream()(Code) | | Default constructor.
|
addUniqueAttribute | public void addUniqueAttribute(String name, String value, int flags) throws SAXException(Code) | | This method is used to add an attribute to the currently open element.
The caller has guaranted that this attribute is unique, which means that it
not been seen before and will not be seen again.
Parameters: name - the qualified name of the attribute Parameters: value - the value of the attribute which can contain onlyASCII printable characters characters in the range 32 to 127 inclusive. Parameters: flags - the bit values of this integer give optimization information. |
cdata | final public void cdata(char ch, int start, int length) throws org.xml.sax.SAXException(Code) | | Receive notification of cdata.
The Parser will call this method to report each chunk of
character data. SAX parsers may return all contiguous character
data in a single chunk, or they may split it into several
chunks; however, all of the characters in any single event
must come from the same external entity, so that the Locator
provides useful information.
The application must not attempt to read from the array
outside of the specified range.
Note that some parsers will report whitespace using the
ignorableWhitespace() method rather than this one (validating
parsers must do so).
Parameters: ch - The characters from the XML document. Parameters: start - The start position in the array. Parameters: length - The number of characters to read from the array. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. See Also: ToHTMLStream.ignorableWhitespace See Also: org.xml.sax.Locator throws: org.xml.sax.SAXException - |
characters | final public void characters(char chars, int start, int length) throws org.xml.sax.SAXException(Code) | | Receive notification of character data.
The Parser will call this method to report each chunk of
character data. SAX parsers may return all contiguous character
data in a single chunk, or they may split it into several
chunks; however, all of the characters in any single event
must come from the same external entity, so that the Locator
provides useful information.
The application must not attempt to read from the array
outside of the specified range.
Note that some parsers will report whitespace using the
ignorableWhitespace() method rather than this one (validating
parsers must do so).
Parameters: chars - The characters from the XML document. Parameters: start - The start position in the array. Parameters: length - The number of characters to read from the array. throws: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. See Also: ToHTMLStream.ignorableWhitespace See Also: org.xml.sax.Locator throws: org.xml.sax.SAXException - |
getElemDesc | final public static ElemDesc getElemDesc(String name)(Code) | | Get a description of the given element.
Parameters: name - non-null name of element, case insensitive. non-null reference to ElemDesc, which may be m_dummy if no element description matches the given name. |
init | protected synchronized void init(OutputStream output, Properties format) throws UnsupportedEncodingException(Code) | | Initialize the serializer with the specified output stream and output
format. Must be called before calling any of the serialize methods.
Parameters: output - The output stream to use Parameters: format - The output format throws: UnsupportedEncodingException - The encoding specified in theoutput format is not supported |
initTagReference | static void initTagReference(Trie m_elementFlags)(Code) | | |
namespaceAfterStartElement | public void namespaceAfterStartElement(String prefix, String uri) throws SAXException(Code) | | This method is used when a prefix/uri namespace mapping
is indicated after the element was started with a
startElement() and before and endElement().
startPrefixMapping(prefix,uri) would be used before the
startElement() call.
Parameters: uri - the URI of the namespace Parameters: prefix - the prefix associated with the given URI. See Also: ExtendedContentHandler.namespaceAfterStartElement(StringString) |
processAttribute | protected void processAttribute(java.io.Writer writer, String name, String value, ElemDesc elemDesc) throws IOException(Code) | | Process an attribute.
Parameters: writer - The writer to write the processed output to. Parameters: name - The name of the attribute. Parameters: value - The value of the attribute. Parameters: elemDesc - The description of the HTML element that has this attribute. throws: org.xml.sax.SAXException - |
processAttributes | public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException(Code) | | Process the attributes, which means to write out the currently
collected attributes to the writer. The attributes are not
cleared by this method
Parameters: writer - the writer to write processed attributes to. Parameters: nAttrs - the number of attributes in m_attributes to be processed throws: org.xml.sax.SAXException - |
reset | public boolean reset()(Code) | | |
setOmitMetaTag | public void setOmitMetaTag(boolean bool)(Code) | | Tells if the formatter should omit the META tag.
Parameters: bool - True if the META tag should be omitted. |
setOutputFormat | public void setOutputFormat(Properties format)(Code) | | Specifies an output format for this serializer. It the
serializer has already been associated with an output format,
it will switch to the new format. This method should not be
called while the serializer is in the process of serializing
a document.
This method can be called multiple times before starting
the serialization of a particular result-tree. In principle
all serialization parameters can be changed, with the exception
of method="html" (it must be method="html" otherwise we
shouldn't even have a ToHTMLStream object here!)
Parameters: format - The output format or serialzation parametersto use. |
setOutputStream | public void setOutputStream(OutputStream output)(Code) | | Specifies an output stream to which the document should be
serialized. This method should not be called while the
serializer is in the process of serializing a document.
The encoding specified in the output properties is used, or
if no encoding was specified, the default for the selected
output method.
Parameters: output - The output stream |
setSpecialEscapeURLs | public void setSpecialEscapeURLs(boolean bool)(Code) | | Tells if the formatter should use special URL escaping.
Parameters: bool - True if URLs should be specially escaped with the %xx form. |
writeAttrString | public void writeAttrString(java.io.Writer writer, String string, String encoding) throws IOException(Code) | | Writes the specified string after substituting specials,
and UTF-16 surrogates for character references &#xnn .
Parameters: string - String to convert to XML format. Parameters: encoding - CURRENTLY NOT IMPLEMENTED. throws: org.xml.sax.SAXException - |
writeAttrURI | public void writeAttrURI(java.io.Writer writer, String string, boolean doURLEscaping) throws IOException(Code) | | Write the specified string after substituting non ASCII characters,
with %HH , where HH is the hex of the byte value.
Parameters: string - String to convert to XML format. Parameters: doURLEscaping - True if we should try to encode as per http://www.ietf.org/rfc/rfc2396.txt. throws: org.xml.sax.SAXException - if a bad surrogate pair is detected. |
Methods inherited from org.apache.xml.serializer.ToStream | protected int accumDefaultEntity(java.io.Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException(Code)(Java Doc) protected int accumDefaultEscape(Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException(Code)(Java Doc) public boolean addAttributeAlways(String uri, String localName, String rawName, String type, String value, boolean xslAttribute)(Code)(Java Doc) public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException(Code)(Java Doc) protected void cdata(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) public void characters(char chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) public void characters(String s) throws org.xml.sax.SAXException(Code)(Java Doc) protected void charactersRaw(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void closeCDATA() throws org.xml.sax.SAXException(Code)(Java Doc) protected void closeStartTag() throws SAXException(Code)(Java Doc) public void comment(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) public void elementDecl(String name, String model) throws SAXException(Code)(Java Doc) public void endCDATA() throws org.xml.sax.SAXException(Code)(Java Doc) public void endDTD() throws org.xml.sax.SAXException(Code)(Java Doc) public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void endElement(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void endNonEscaping() throws org.xml.sax.SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException(Code)(Java Doc) protected String ensureAttributesNamespaceIsDeclared(String ns, String localName, String rawName) throws org.xml.sax.SAXException(Code)(Java Doc) void ensurePrefixIsDeclared(String ns, String rawName) throws org.xml.sax.SAXException(Code)(Java Doc) protected boolean escapingNotNeeded(char ch)(Code)(Java Doc) public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc) protected void firePseudoAttributes()(Code)(Java Doc) public void flushPending() throws SAXException(Code)(Java Doc) final protected void flushWriter() throws org.xml.sax.SAXException(Code)(Java Doc) public int getIndentAmount()(Code)(Java Doc) public Properties getOutputFormat()(Code)(Java Doc) public OutputStream getOutputStream()(Code)(Java Doc) public Writer getWriter()(Code)(Java Doc) public void ignorableWhitespace(char ch, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void indent(int depth) throws IOException(Code)(Java Doc) protected void indent() throws IOException(Code)(Java Doc) protected synchronized void init(OutputStream output, Properties format, boolean defaultProperties) throws UnsupportedEncodingException(Code)(Java Doc) public void internalEntityDecl(String name, String value) throws SAXException(Code)(Java Doc) public void notationDecl(String name, String pubID, String sysID) throws SAXException(Code)(Java Doc) void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException(Code)(Java Doc) void outputEntityDecl(String name, String value) throws IOException(Code)(Java Doc) final protected void outputLineSep() throws IOException(Code)(Java Doc) public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException(Code)(Java Doc) public boolean reset()(Code)(Java Doc) public void serialize(Node node) throws IOException(Code)(Java Doc) public void setCdataSectionElements(Vector URI_and_localNames)(Code)(Java Doc) public void setContentHandler(ContentHandler ch)(Code)(Java Doc) public void setDTDEntityExpansion(boolean expand)(Code)(Java Doc) public void setEncoding(String encoding)(Code)(Java Doc) public boolean setEscaping(boolean escape)(Code)(Java Doc) public void setIndentAmount(int m_indentAmount)(Code)(Java Doc) public boolean setLineSepUse(boolean use_sytem_line_break)(Code)(Java Doc) public void setOutputFormat(Properties format)(Code)(Java Doc) public void setOutputStream(OutputStream output)(Code)(Java Doc) public void setTransformer(Transformer transformer)(Code)(Java Doc) public void setWriter(Writer writer)(Code)(Java Doc) protected boolean shouldIndent()(Code)(Java Doc) public void skippedEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void startCDATA() throws org.xml.sax.SAXException(Code)(Java Doc) public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException(Code)(Java Doc) public void startElement(String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException(Code)(Java Doc) public void startElement(String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException(Code)(Java Doc) public void startElement(String elementName) throws SAXException(Code)(Java Doc) public void startEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void startNonEscaping() throws org.xml.sax.SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException(Code)(Java Doc) public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws org.xml.sax.SAXException(Code)(Java Doc) public void unparsedEntityDecl(String name, String pubID, String sysID, String notationName) throws SAXException(Code)(Java Doc) public void writeAttrString(Writer writer, String string, String encoding) throws IOException(Code)(Java Doc) void writeNormalizedChars(char ch, int start, int length, boolean isCData, boolean useSystemLineSeparator) throws IOException, org.xml.sax.SAXException(Code)(Java Doc) protected int writeUTF16Surrogate(char c, char ch, int i, int end) throws IOException(Code)(Java Doc)
|
Methods inherited from org.apache.xml.serializer.SerializerBase | public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException(Code)(Java Doc) public void addAttribute(String name, String value)(Code)(Java Doc) public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException(Code)(Java Doc) public boolean addAttributeAlways(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)(Code)(Java Doc) public void addAttributes(Attributes atts) throws SAXException(Code)(Java Doc) public void addXSLAttribute(String name, String value, String uri)(Code)(Java Doc) public ContentHandler asContentHandler() throws IOException(Code)(Java Doc) public DOMSerializer asDOMSerializer() throws IOException(Code)(Java Doc) public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException(Code)(Java Doc) public void close()(Code)(Java Doc) public void comment(String data) throws SAXException(Code)(Java Doc) public void endEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void entityReference(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void error(SAXParseException exc) throws SAXException(Code)(Java Doc) public void fatalError(SAXParseException exc) throws SAXException(Code)(Java Doc) protected void fireCDATAEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireCharEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireCommentEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEndDoc() throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEndElem(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public void fireEndEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEntityReference(String name) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireEscapingEvent(String name, String data) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireStartDoc() throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireStartElem(String elemName) throws org.xml.sax.SAXException(Code)(Java Doc) protected void fireStartEntity(String name) throws org.xml.sax.SAXException(Code)(Java Doc) public String getDoctypePublic()(Code)(Java Doc) public String getDoctypeSystem()(Code)(Java Doc) public String getEncoding()(Code)(Java Doc) public boolean getIndent()(Code)(Java Doc) public int getIndentAmount()(Code)(Java Doc) protected static String getLocalName(String qname)(Code)(Java Doc) public String getMediaType()(Code)(Java Doc) public NamespaceMappings getNamespaceMappings()(Code)(Java Doc) public String getNamespaceURI(String qname, boolean isElement)(Code)(Java Doc) public String getNamespaceURIFromPrefix(String prefix)(Code)(Java Doc) public boolean getOmitXMLDeclaration()(Code)(Java Doc) public String getPrefix(String namespaceURI)(Code)(Java Doc) final protected static String getPrefixPart(String qname)(Code)(Java Doc) public String getStandalone()(Code)(Java Doc) public Transformer getTransformer()(Code)(Java Doc) public String getVersion()(Code)(Java Doc) final boolean inTemporaryOutputState()(Code)(Java Doc) protected void initCDATA()(Code)(Java Doc) protected boolean isCdataSection()(Code)(Java Doc) public void namespaceAfterStartElement(String uri, String prefix) throws SAXException(Code)(Java Doc) public void notationDecl(String arg0, String arg1, String arg2) throws SAXException(Code)(Java Doc) protected String patchName(String qname)(Code)(Java Doc) public boolean reset()(Code)(Java Doc) public void setDTDEntityExpansion(boolean expand)(Code)(Java Doc) public void setDoctype(String doctypeSystem, String doctypePublic)(Code)(Java Doc) public void setDoctypePublic(String doctypePublic)(Code)(Java Doc) public void setDoctypeSystem(String doctypeSystem)(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void setEncoding(String m_encoding)(Code)(Java Doc) public void setIndent(boolean doIndent)(Code)(Java Doc) public void setIndentAmount(int m_indentAmount)(Code)(Java Doc) public void setMediaType(String mediaType)(Code)(Java Doc) public void setNamespaceMappings(NamespaceMappings mappings)(Code)(Java Doc) public void setOmitXMLDeclaration(boolean b)(Code)(Java Doc) public void setSourceLocator(SourceLocator locator)(Code)(Java Doc) public void setStandalone(String standalone)(Code)(Java Doc) protected void setStandaloneInternal(String standalone)(Code)(Java Doc) public void setTransformer(Transformer t)(Code)(Java Doc) public void setVersion(String version)(Code)(Java Doc) public void startDocument() throws org.xml.sax.SAXException(Code)(Java Doc) protected void startDocumentInternal() throws org.xml.sax.SAXException(Code)(Java Doc) public void unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3) throws SAXException(Code)(Java Doc) public void warning(SAXParseException exc) throws SAXException(Code)(Java Doc)
|
|
|