Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.xml.serializer.SerializerBase
org.apache.xml.serializer.ToStream
org.apache.xml.serializer.ToHTMLStream
public class ToHTMLStream
extends ToStream
Fields inherited from interface org.apache.xml.serializer.ExtendedContentHandler | |
HTML_ATTREMPTY , HTML_ATTRURL , NO_BAD_CHARS |
Fields inherited from interface org.apache.xml.serializer.SerializerConstants | |
BEGCDATA , CDATA_CONTINUE , CDATA_DELIMITER_CLOSE , CDATA_DELIMITER_OPEN , CNTCDATA , DEFAULT_SAX_SERIALIZER , EMPTYSTRING , ENDCDATA , ENTITY_AMP , ENTITY_CRLF , ENTITY_GT , ENTITY_LT , ENTITY_QUOT , XMLNS_PREFIX , XMLNS_URI , XML_PREFIX |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
static ElemDesc |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public void addUniqueAttribute(String name, String value, int flags) throws SAXException
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.
- Specified by:
- addUniqueAttribute in interface ExtendedContentHandler
- Parameters:
name
- the qualified name of the attributevalue
- the value of the attribute which can contain only ASCII printable characters characters in the range 32 to 127 inclusive.flags
- the bit values of this integer give optimization information.
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException
This method does nothing.
- Specified by:
- attributeDecl in interface DeclHandler
- Overrides:
- attributeDecl in interface ToStream
public final void cdata(ch[] , int start, int length) throws SAXException
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:
start
- The start position in the array.length
- The number of characters to read from the array.
- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.SAXException
-
- See Also:
ToHTMLStream
,Locator
public final void characters(chars[] , int start, int length) throws SAXException
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).
- Overrides:
- characters in interface ToStream
- Parameters:
start
- The start position in the array.length
- The number of characters to read from the array.
- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.SAXException
-
- See Also:
ToHTMLStream
,Locator
public void comment(ch[] , int start, int length) throws SAXException
Receive notification of an XML comment anywhere in the document. This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read).
- Specified by:
- comment in interface LexicalHandler
- Parameters:
start
- The starting position in the array.length
- The number of characters to use from the array.
- Throws:
SAXException
- The application may raise an exception.
public void elementDecl(String name, String model) throws SAXException
This method does nothing.
- Specified by:
- elementDecl in interface DeclHandler
- Overrides:
- elementDecl in interface ToStream
public void endDTD() throws SAXException
Report the end of DTD declarations.
- Specified by:
- endDTD in interface LexicalHandler
- Throws:
SAXException
- The application may raise an exception.
- See Also:
startDTD(String,String,String)
public final void endDocument() throws SAXException
Receive notification of the end of a document.
- Specified by:
- endDocument in interface ContentHandler
- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.SAXException
-
public final void endElement(String elemName) throws SAXException
- Specified by:
- endElement in interface ExtendedContentHandler
- Overrides:
- endElement in interface ToStream
public final void endElement(String namespaceURI, String localName, String name) throws SAXException
Receive notification of the end of an element.
- Specified by:
- endElement in interface ContentHandler
- Overrides:
- endElement in interface ToStream
- Parameters:
namespaceURI
-localName
-name
- The element type name
- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.
public final void entityReference(String name) throws SAXException
Receive notivication of a entityReference.
- Specified by:
- entityReference in interface ExtendedContentHandler
- Overrides:
- entityReference in interface SerializerBase
- Parameters:
name
- non-null reference to entity name string.
- Throws:
SAXException
-
public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException
This method does nothing.
- Specified by:
- externalEntityDecl in interface DeclHandler
- Overrides:
- externalEntityDecl in interface ToStream
public static final ElemDesc getElemDesc(String name)
Get a description of the given element.
- Parameters:
name
- non-null name of element, case insensitive.
- Returns:
- non-null reference to ElemDesc, which may be m_dummy if no element description matches the given name.
public void internalEntityDecl(String name, String value) throws SAXException
This method does nothing.
- Specified by:
- internalEntityDecl in interface DeclHandler
- Overrides:
- internalEntityDecl in interface ToStream
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException
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.
- Specified by:
- namespaceAfterStartElement in interface ExtendedContentHandler
- Overrides:
- namespaceAfterStartElement in interface SerializerBase
- Parameters:
prefix
- the prefix associated with the given URI.uri
- the URI of the namespace
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException
Process the attributes, which means to write out the currently collected attributes to the writer. The attributes are not cleared by this method
- Overrides:
- processAttributes in interface ToStream
- Parameters:
writer
- the writer to write processed attributes to.nAttrs
- the number of attributes in m_attributes to be processed
- Throws:
SAXException
-
public void processingInstruction(String target, String data) throws SAXException
Receive notification of a processing instruction.
- Specified by:
- processingInstruction in interface ContentHandler
- Parameters:
target
- The processing instruction target.data
- The processing instruction data, or null if none was supplied.
- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.SAXException
-
public boolean reset()
Try's to reset the super class and reset this class for re-use, so that you don't need to create a new serializer (mostly for performance reasons).
- Specified by:
- reset in interface Serializer
- Returns:
- true if the class was successfuly reset.
public void setOmitMetaTag(boolean bool)
Tells if the formatter should omit the META tag.
- Parameters:
bool
- True if the META tag should be omitted.
public void setOutputFormat(Properties format)
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.
- Specified by:
- setOutputFormat in interface Serializer
- Overrides:
- setOutputFormat in interface ToStream
- Parameters:
format
- The output format to use
public void setOutputStream(OutputStream output)
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.
- Specified by:
- setOutputStream in interface Serializer
- Overrides:
- setOutputStream in interface ToStream
- Parameters:
output
- The output stream
public void setSpecialEscapeURLs(boolean bool)
Tells if the formatter should use special URL escaping.
- Parameters:
bool
- True if URLs should be specially escaped with the %xx form.
public void startDTD(String name, String publicId, String systemId) throws SAXException
Report the start of DTD declarations, if any. Any declarations are assumed to be in the internal subset unless otherwise indicated.
- Specified by:
- startDTD in interface LexicalHandler
- Parameters:
name
- The document type name.publicId
- The declared public identifier for the external DTD subset, or null if none was declared.systemId
- The declared system identifier for the external DTD subset, or null if none was declared.
- Throws:
SAXException
- The application may raise an exception.
public void startElement(String namespaceURI, String localName, String name, Attributes atts) throws SAXException
Receive notification of the beginning of an element.
- Specified by:
- startElement in interface ContentHandler
- Overrides:
- startElement in interface ToStream
- Parameters:
namespaceURI
-localName
-name
- The element type name.atts
- The attributes attached to the element, if any.
- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.
- See Also:
endElement
,AttributeList
public void writeAttrString(java.io.Writer writer, String string, String encoding) throws IOException
Writes the specified string after substituting specials, and UTF-16 surrogates for character references&#xnn
.
- Parameters:
string
- String to convert to XML format.encoding
- CURRENTLY NOT IMPLEMENTED.
public void writeAttrURI(java.io.Writer writer, String string, boolean doURLEscaping) throws IOException
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.doURLEscaping
- True if we should try to encode as per http://www.ietf.org/rfc/rfc2396.txt.