addUniqueAttribute
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.
- addUniqueAttribute in interface ExtendedContentHandler
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.
attributeDecl
public void attributeDecl(String eName,
String aName,
String type,
String valueDefault,
String value)
throws SAXException
This method does nothing.
- attributeDecl in interface ToStream
cdata
public final void cdata(ch[] ,
int start,
int length)
throws org.xml.sax.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).
start
- The start position in the array.length
- The number of characters to read from the array.
ToHTMLStream
, org.xml.sax.Locator
characters
public final void characters(chars[] ,
int start,
int length)
throws org.xml.sax.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).
- characters in interface ToStream
start
- The start position in the array.length
- The number of characters to read from the array.
ToHTMLStream
, org.xml.sax.Locator
comment
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).
- comment in interface ToStream
start
- The starting position in the array.length
- The number of characters to use from the array.
elementDecl
public void elementDecl(String name,
String model)
throws SAXException
This method does nothing.
- elementDecl in interface ToStream
endDTD
public void endDTD()
throws org.xml.sax.SAXException
Report the end of DTD declarations.
- endDTD in interface ToStream
endDocument
public final void endDocument()
throws org.xml.sax.SAXException
Receive notification of the end of a document.
endElement
public final void endElement(String namespaceURI,
String localName,
String name)
throws org.xml.sax.SAXException
Receive notification of the end of an element.
- endElement in interface ToStream
namespaceURI
- localName
- name
- The element type name
externalEntityDecl
public void externalEntityDecl(String name,
String publicId,
String systemId)
throws SAXException
This method does nothing.
- externalEntityDecl in interface ToStream
getElemDesc
public static final ElemDesc getElemDesc(String name)
Get a description of the given element.
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.
internalEntityDecl
public void internalEntityDecl(String name,
String value)
throws SAXException
This method does nothing.
- internalEntityDecl in interface ToStream
namespaceAfterStartElement
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.
- namespaceAfterStartElement in interface ExtendedContentHandler
- namespaceAfterStartElement in interface SerializerBase
prefix
- the prefix associated with the given URI.uri
- the URI of the namespace
processAttributes
public void processAttributes(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
- processAttributes in interface ToStream
writer
- the writer to write processed attributes to.nAttrs
- the number of attributes in m_attributes
to be processed
processingInstruction
public void processingInstruction(String target,
String data)
throws org.xml.sax.SAXException
Receive notification of a processing instruction.
target
- The processing instruction target.data
- The processing instruction data, or null if
none was supplied.
reset
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).
- reset in interface Serializer
- reset in interface ToStream
- true if the class was successfuly reset.
setOmitMetaTag
public void setOmitMetaTag(boolean bool)
Tells if the formatter should omit the META tag.
bool
- True if the META tag should be omitted.
setOutputFormat
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.
- setOutputFormat in interface Serializer
- setOutputFormat in interface ToStream
format
- The output format to use
setOutputStream
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.
- setOutputStream in interface Serializer
- setOutputStream in interface ToStream
output
- The output stream
setSpecialEscapeURLs
public void setSpecialEscapeURLs(boolean bool)
Tells if the formatter should use special URL escaping.
bool
- True if URLs should be specially escaped with the %xx form.
startDTD
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.
- startDTD in interface ToStream
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.
startElement
public void startElement(String namespaceURI,
String localName,
String name,
Attributes atts)
throws org.xml.sax.SAXException
Receive notification of the beginning of an element.
- startElement in interface ToStream
namespaceURI
- localName
- name
- The element type name.atts
- The attributes attached to the element, if any.
endElement
, org.xml.sax.AttributeList
writeAttrString
public void writeAttrString(Writer writer,
String string,
String encoding)
throws IOException
Writes the specified string after substituting specials,
and UTF-16 surrogates for character references &#xnn
.
string
- String to convert to XML format.encoding
- CURRENTLY NOT IMPLEMENTED.
writeAttrURI
public void writeAttrURI(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.
string
- String to convert to XML format.doURLEscaping
- True if we should try to encode as
per http://www.ietf.org/rfc/rfc2396.txt.