|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xml.serializer.SerializerBase | +--org.apache.xml.serializer.ToStream | +--org.apache.xml.serializer.ToHTMLStream
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.
Fields inherited from class org.apache.xml.serializer.SerializerBase |
PKG_NAME,
PKG_PATH |
Constructor Summary | |
ToHTMLStream()
Default constructor. |
Method Summary | |
void |
addUniqueAttribute(java.lang.String name,
java.lang.String value,
int flags)
This method is used to add an attribute to the currently open element. |
void |
attributeDecl(java.lang.String eName,
java.lang.String aName,
java.lang.String type,
java.lang.String valueDefault,
java.lang.String value)
This method does nothing. |
void |
cdata(char[] ch,
int start,
int length)
Receive notification of cdata. |
void |
characters(char[] chars,
int start,
int length)
Receive notification of character data. |
void |
comment(char[] ch,
int start,
int length)
|
void |
elementDecl(java.lang.String name,
java.lang.String model)
This method does nothing. |
void |
endDocument()
Receive notification of the end of a document. |
void |
endDTD()
Report the end of DTD declarations. |
void |
endElement(java.lang.String elemName)
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String name)
Receive notification of the end of an element. |
void |
entityReference(java.lang.String name)
Receive notivication of a entityReference. |
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
This method does nothing. |
static ElemDesc |
getElemDesc(java.lang.String name)
Get a description of the given element. |
void |
internalEntityDecl(java.lang.String name,
java.lang.String value)
This method does nothing. |
void |
namespaceAfterStartElement(java.lang.String prefix,
java.lang.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(). |
void |
processAttributes(java.io.Writer writer,
int nAttrs)
Process the attributes, which means to write out the currently collected attributes to the writer. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Receive notification of a processing instruction. |
boolean |
reset()
|
void |
setOmitMetaTag(boolean bool)
Tells if the formatter should omit the META tag. |
void |
setOutputFormat(java.util.Properties format)
Specifies an output format for this serializer. |
void |
setSpecialEscapeURLs(boolean bool)
Tells if the formatter should use special URL escaping. |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String name,
Attributes atts)
Receive notification of the beginning of an element. |
void |
writeAttrString(java.io.Writer writer,
java.lang.String string,
java.lang.String encoding)
Writes the specified string after substituting specials, and UTF-16 surrogates for character references &#xnn . |
void |
writeAttrURI(java.io.Writer writer,
java.lang.String string,
boolean doURLEscaping)
Write the specified string after substituting non ASCII characters, with %HH , where HH is the hex of the byte value. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ToHTMLStream()
Method Detail |
public void setSpecialEscapeURLs(boolean bool)
bool
- True if URLs should be specially escaped with the %xx form.public void setOmitMetaTag(boolean bool)
bool
- True if the META tag should be omitted.public void setOutputFormat(java.util.Properties format)
format
- The output format or serialzation parameters
to use.public static final ElemDesc getElemDesc(java.lang.String name)
name
- non-null name of element, case insensitive.public final void endDocument() throws SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name, Attributes atts) throws SAXException
namespaceURI
- localName
- name
- The element type name.atts
- The attributes attached to the element, if any.endElement(java.lang.String, java.lang.String, java.lang.String)
,
AttributeList
public final void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name) throws SAXException
namespaceURI
- localName
- name
- The element type namepublic void writeAttrURI(java.io.Writer writer, java.lang.String string, boolean doURLEscaping) throws java.io.IOException
%HH
, where HH is the hex of the byte value.string
- String to convert to XML format.doURLEscaping
- True if we should try to encode as
per http://www.ietf.org/rfc/rfc2396.txt.public void writeAttrString(java.io.Writer writer, java.lang.String string, java.lang.String encoding) throws java.io.IOException
&#xnn
.string
- String to convert to XML format.encoding
- CURRENTLY NOT IMPLEMENTED.public final void characters(char[] chars, int start, int length) throws SAXException
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).
chars
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.ToStream.ignorableWhitespace(char[], int, int)
,
Locator
public final void cdata(char[] ch, int start, int length) throws SAXException
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).
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.ToStream.ignorableWhitespace(char[], int, int)
,
Locator
public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
target
- The processing instruction target.data
- The processing instruction data, or null if
none was supplied.public final void entityReference(java.lang.String name) throws SAXException
name
- non-null reference to entity name string.public final void endElement(java.lang.String elemName) throws SAXException
ExtendedContentHandler.endElement(String)
public void processAttributes(java.io.Writer writer, int nAttrs) throws java.io.IOException, SAXException
writer
- the writer to write processed attributes to.nAttrs
- the number of attributes in m_attributes
to be processedpublic void namespaceAfterStartElement(java.lang.String prefix, java.lang.String uri) throws SAXException
uri
- the URI of the namespaceprefix
- the prefix associated with the given URI.ExtendedContentHandler.namespaceAfterStartElement(String, String)
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
public void endDTD() throws SAXException
startDTD(java.lang.String, java.lang.String, java.lang.String)
public void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String valueDefault, java.lang.String value) throws SAXException
public void elementDecl(java.lang.String name, java.lang.String model) throws SAXException
public void internalEntityDecl(java.lang.String name, java.lang.String value) throws SAXException
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
public void addUniqueAttribute(java.lang.String name, java.lang.String value, int flags) throws SAXException
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 comment(char[] ch, int start, int length) throws SAXException
public boolean reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |