|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ajax4jsf.xml.serializer.SerializerBase
org.ajax4jsf.xml.serializer.ToStream
public abstract class ToStream
This abstract class is a base class for other stream serializers (xml, html, text ...) that write output to a stream.
Field Summary | |
---|---|
static java.lang.String |
CDATA_CONTINUE
To insert ]]> in a CDATA section by ending the last CDATA section with ]] and starting the next CDATA section with > |
static java.lang.String |
CDATA_DELIMITER_CLOSE
The constant "]]>" |
static java.lang.String |
CDATA_DELIMITER_OPEN
|
static java.lang.String |
DEFAULT_SAX_SERIALIZER
|
static java.lang.String |
EMPTYSTRING
|
static java.lang.String |
ENTITY_AMP
|
static java.lang.String |
ENTITY_CRLF
|
static java.lang.String |
ENTITY_GT
|
static java.lang.String |
ENTITY_LT
|
static java.lang.String |
ENTITY_QUOT
|
static int |
HTML_ATTREMPTY
|
static int |
HTML_ATTRURL
|
protected boolean |
m_cdataStartCalled
remembers if we are in between the startCDATA() and endCDATA() callbacks |
protected org.ajax4jsf.xml.serializer.CharInfo |
m_charInfo
Map that tells which characters should have special treatment, and it provides character to entity name lookup. |
protected org.ajax4jsf.xml.serializer.ToStream.BoolStack |
m_disableOutputEscapingStates
Stack to keep track of disabling output escaping. |
protected java.util.Properties |
m_format
The xsl:output properties. |
protected boolean |
m_inDoctype
Tells if we're in an internal document type subset. |
protected boolean |
m_ispreserve
State flag to tell if preservation of whitespace is important. |
protected boolean |
m_isprevtext
State flag that tells if the previous node processed was text, so we can tell if we should preserve whitespace. |
protected char[] |
m_lineSep
The system line separator for writing out line breaks. |
protected int |
m_lineSepLen
The length of the line seperator, since the write is done one character at a time. |
protected boolean |
m_lineSepUse
True if the the system line separator is to be used. |
protected org.ajax4jsf.xml.serializer.ToStream.BoolStack |
m_preserves
Stack to keep track of whether or not we need to preserve whitespace. |
protected boolean |
m_spaceBeforeClose
Add space before '/>' for XHTML. |
static int |
NO_BAD_CHARS
|
static java.lang.String |
XML_PREFIX
|
static java.lang.String |
XMLNS_PREFIX
|
static java.lang.String |
XMLNS_URI
|
static java.lang.String |
XMLVERSION10
|
static java.lang.String |
XMLVERSION11
Define the XML version. |
Fields inherited from class org.ajax4jsf.xml.serializer.SerializerBase |
---|
m_attrBuff, m_attributes, m_cdataSectionElements, m_cdataTagOpen, m_charsBuff, m_doIndent, m_elemContext, m_indentAmount, m_inEntityRef, m_inExternalDTD, m_needToCallStartDocument, m_prefixMap, m_sourceLocator, m_standaloneWasSpecified, m_tracer, m_writer |
Constructor Summary | |
---|---|
ToStream()
Default constructor |
Method Summary | |
---|---|
protected int |
accumDefaultEntity(java.io.Writer writer,
char ch,
int i,
char[] chars,
int len,
boolean fromTextNode,
boolean escLF)
Handle one of the default entities, return false if it is not a default entity. |
protected int |
accumDefaultEscape(java.io.Writer writer,
char ch,
int i,
char[] chars,
int len,
boolean fromTextNode,
boolean escLF)
Escape and writer.write a character. |
boolean |
addAttributeAlways(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
java.lang.String type,
java.lang.String value,
boolean xslAttribute)
Adds the given attribute to the set of attributes, even if there is no currently open element. |
void |
addUniqueAttribute(java.lang.String qName,
java.lang.String value,
int flags)
Add a unique attribute to the current element. |
void |
attributeDecl(java.lang.String eName,
java.lang.String aName,
java.lang.String type,
java.lang.String valueDefault,
java.lang.String value)
Report an attribute type declaration. |
protected 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 |
characters(java.lang.String s)
Receive notification of character data. |
protected void |
charactersRaw(char[] ch,
int start,
int length)
If available, when the disable-output-escaping attribute is used, output raw text without escaping. |
protected void |
closeCDATA()
This helper method to writes out "]]>" when closing a CDATA section. |
protected void |
closeStartTag()
For the enclosing elements starting tag write out out any attributes followed by ">" |
void |
comment(char[] ch,
int start,
int length)
Receive notification of an XML comment anywhere in the document. |
void |
elementDecl(java.lang.String name,
java.lang.String model)
Report an element type declaration. |
void |
endCDATA()
Report the end of a CDATA section. |
void |
endDTD()
Report the end of DTD declarations. |
void |
endElement(java.lang.String name)
Receive notification of the end of an element. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String name)
Receive notification of the end of an element. |
void |
endNonEscaping()
Ends an un-escaping section. |
void |
endPrefixMapping(java.lang.String prefix)
End the scope of a prefix-URI Namespace mapping. |
protected java.lang.String |
ensureAttributesNamespaceIsDeclared(java.lang.String ns,
java.lang.String localName,
java.lang.String rawName)
Makes sure that the namespace URI for the given qualified attribute name is declared. |
protected boolean |
escapingNotNeeded(char ch)
Tell if this character can be written without escaping. |
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Report a parsed external entity declaration. |
protected void |
firePseudoAttributes()
To fire off the pseudo characters of attributes, as they currently exist. |
void |
flushPending()
This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section. |
protected void |
flushWriter()
Flush the formatter's result stream. |
int |
getIndentAmount()
Returns the m_indentAmount. |
java.util.Properties |
getOutputFormat()
Returns the output format for this serializer. |
java.io.OutputStream |
getOutputStream()
Get the output stream where the events will be serialized to. |
java.io.Writer |
getWriter()
Get the character stream where the events will be serialized to. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Receive notification of ignorable whitespace in element content. |
protected void |
indent()
Indent at the current element nesting depth. |
protected void |
indent(int depth)
Might print a newline character and the indentation amount of the given depth. |
protected void |
init(java.io.OutputStream output,
java.util.Properties format,
boolean defaultProperties)
Initialize the serializer with the specified output stream and output format. |
void |
internalEntityDecl(java.lang.String name,
java.lang.String value)
Report an internal entity declaration. |
void |
notationDecl(java.lang.String name,
java.lang.String pubID,
java.lang.String sysID)
If this method is called, the serializer is used as a DTDHandler, which changes behavior how the serializer handles document entities. |
protected void |
outputLineSep()
Output a system-dependent line break. |
void |
processAttributes(java.io.Writer writer,
int nAttrs)
Process the attributes, which means to write out the currently collected attributes to the writer. |
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). |
void |
serialize(org.w3c.dom.Node node)
Serializes the DOM node. |
void |
setCdataSectionElements(java.util.Vector URI_and_localNames)
Remembers the cdata sections specified in the cdata-section-elements. |
void |
setContentHandler(org.xml.sax.ContentHandler ch)
Set the SAX Content handler that the serializer sends its output to. |
void |
setDTDEntityExpansion(boolean expand)
If set to false the serializer does not expand DTD entities, but leaves them as is, the default value is true; |
void |
setEncoding(java.lang.String encoding)
Sets the character encoding coming from the xsl:output encoding stylesheet attribute. |
boolean |
setEscaping(boolean escape)
Turns special character escaping on/off. |
void |
setIndentAmount(int m_indentAmount)
Sets the m_indentAmount. |
boolean |
setLineSepUse(boolean use_sytem_line_break)
Set if the operating systems end-of-line line separator should be used when serializing. |
void |
setOutputFormat(java.util.Properties format)
Specifies an output format for this serializer. |
void |
setOutputStream(java.io.OutputStream output)
Specifies an output stream to which the document should be serialized. |
void |
setTransformer(javax.xml.transform.Transformer transformer)
Sets the transformer associated with this serializer |
void |
setWriter(java.io.Writer writer)
Specifies a writer to which the document should be serialized. |
protected boolean |
shouldIndent()
Tell if, based on space preservation constraints and the doIndent property, if an indent should occur. |
void |
skippedEntity(java.lang.String name)
Receive notification of a skipped entity. |
void |
startCDATA()
Report the start of a CDATA section. |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Report the start of DTD declarations, if any. |
void |
startElement(java.lang.String elementName)
This method is used to notify of the start of an element |
void |
startElement(java.lang.String elementNamespaceURI,
java.lang.String elementLocalName,
java.lang.String elementName)
Receive notification of the beginning of an element, additional namespace or attribute information can occur before or after this call, that is associated with this element. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes atts)
Receive notification of the beginning of an element, although this is a SAX method additional namespace or attribute information can occur before or after this call, that is associated with this element. |
void |
startEntity(java.lang.String name)
Report the beginning of an entity. |
void |
startNonEscaping()
Starts an un-escaping section. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Begin the scope of a prefix-URI Namespace mapping just before another element is about to start. |
boolean |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri,
boolean shouldFlush)
Handle a prefix/uri mapping, which is associated with a startElement() that is soon to follow. |
void |
unparsedEntityDecl(java.lang.String name,
java.lang.String pubID,
java.lang.String sysID,
java.lang.String notationName)
If this method is called, the serializer is used as a DTDHandler, which changes behavior how the serializer handles document entities. |
void |
writeAttrString(java.io.Writer writer,
java.lang.String string,
java.lang.String encoding)
Returns the specified string after substituting specials, and UTF-16 surrogates for chracter references &#xnn . |
protected int |
writeUTF16Surrogate(char c,
char[] ch,
int i,
int end)
Once a surrogate has been detected, write out the pair of characters if it is in the encoding, or if there is no encoding, otherwise write out an entity reference of the value of the unicode code point of the character represented by the high/low surrogate pair. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
---|
endDocument, processingInstruction |
Field Detail |
---|
protected org.ajax4jsf.xml.serializer.ToStream.BoolStack m_disableOutputEscapingStates
protected org.ajax4jsf.xml.serializer.ToStream.BoolStack m_preserves
protected boolean m_ispreserve
protected boolean m_isprevtext
protected char[] m_lineSep
protected boolean m_lineSepUse
protected int m_lineSepLen
protected org.ajax4jsf.xml.serializer.CharInfo m_charInfo
protected boolean m_spaceBeforeClose
protected boolean m_inDoctype
protected java.util.Properties m_format
protected boolean m_cdataStartCalled
public static final int NO_BAD_CHARS
public static final int HTML_ATTREMPTY
public static final int HTML_ATTRURL
public static final java.lang.String CDATA_CONTINUE
public static final java.lang.String CDATA_DELIMITER_CLOSE
public static final java.lang.String CDATA_DELIMITER_OPEN
public static final java.lang.String EMPTYSTRING
public static final java.lang.String ENTITY_AMP
public static final java.lang.String ENTITY_CRLF
public static final java.lang.String ENTITY_GT
public static final java.lang.String ENTITY_LT
public static final java.lang.String ENTITY_QUOT
public static final java.lang.String XML_PREFIX
public static final java.lang.String XMLNS_PREFIX
public static final java.lang.String XMLNS_URI
public static final java.lang.String DEFAULT_SAX_SERIALIZER
public static final java.lang.String XMLVERSION11
public static final java.lang.String XMLVERSION10
Constructor Detail |
---|
public ToStream()
Method Detail |
---|
protected void closeCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void serialize(org.w3c.dom.Node node) throws java.io.IOException
node
- Node to serialize.
java.io.IOException
- An I/O exception occured while serializingprotected final void flushWriter() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public java.io.OutputStream getOutputStream()
public void elementDecl(java.lang.String name, java.lang.String model) throws org.xml.sax.SAXException
The content model will consist of the string "EMPTY", the string "ANY", or a parenthesised group, optionally followed by an occurrence indicator. The model will be normalized so that all whitespace is removed,and will include the enclosing parentheses.
name
- The element type name.model
- The content model as a normalized string.
org.xml.sax.SAXException
- The application may raise an exception.public void internalEntityDecl(java.lang.String name, java.lang.String value) throws org.xml.sax.SAXException
Only the effective (first) declaration for each entity will be reported.
name
- The name of the entity. If it is a parameter
entity, the name will begin with '%'.value
- The replacement text of the entity.
org.xml.sax.SAXException
- The application may raise an exception.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
,
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
protected final void outputLineSep() throws java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public void setOutputFormat(java.util.Properties format)
format
- The output format to useprotected void init(java.io.OutputStream output, java.util.Properties format, boolean defaultProperties) throws java.io.UnsupportedEncodingException
output
- The output stream to useformat
- The output formatdefaultProperties
- true if the properties are the default
properties
java.io.UnsupportedEncodingException
- The encoding specified in the
output format is not supportedpublic java.util.Properties getOutputFormat()
public void setWriter(java.io.Writer writer)
writer
- The output writer streampublic boolean setLineSepUse(boolean use_sytem_line_break)
use_sytem_line_break
- True if an input NL is replaced with the
operating systems end-of-line separator.
public void setOutputStream(java.io.OutputStream output)
The encoding specified in the output properties is used, or if no encoding was specified, the default for the selected output method.
output
- The output streampublic boolean setEscaping(boolean escape)
SerializationHandler
escape
- true if escaping is to be set on.SerializationHandler.setEscaping(boolean)
protected void indent(int depth) throws java.io.IOException
depth
- the indentation depth (element nesting depth)
org.xml.sax.SAXException
- if an error occurs during writing.
java.io.IOException
protected void indent() throws java.io.IOException
java.io.IOException
public void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String valueDefault, java.lang.String value) throws org.xml.sax.SAXException
Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION", or a parenthesized token group with the separator "|" and all whitespace removed.
eName
- The name of the associated element.aName
- The name of the attribute.type
- A string representing the attribute type.valueDefault
- A string representing the attribute default
("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
none of these applies.value
- A string representing the attribute's default value,
or null if there is none.
org.xml.sax.SAXException
- The application may raise an exception.public java.io.Writer getWriter()
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
Only the effective (first) declaration for each entity will be reported.
name
- The name of the entity. If it is a parameter
entity, the name will begin with '%'.publicId
- The declared public identifier of the entity, or
null if none was declared.systemId
- The declared system identifier of the entity.
org.xml.sax.SAXException
- The application may raise an exception.internalEntityDecl(java.lang.String, java.lang.String)
,
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
protected boolean escapingNotNeeded(char ch)
protected int writeUTF16Surrogate(char c, char[] ch, int i, int end) throws java.io.IOException
An exception is thrown if there is no low surrogate in the pair, because the array ends unexpectely, or if the low char is there but its value is such that it is not a low surrogate.
c
- the first (high) part of the surrogate, which
must be confirmed before calling this method.ch
- Character array.i
- position Where the surrogate was detected.end
- The end index of the significant characters.
java.io.IOException
org.xml.sax.SAXException
- if invalid UTF-16 surrogate detected.protected int accumDefaultEntity(java.io.Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws java.io.IOException
ch
- character to be escaped.i
- index into character array.chars
- non-null reference to character array.len
- length of chars.fromTextNode
- true if the characters being processed
are from a text node, false if they are from an attribute valueescLF
- true if the linefeed should be escaped.
java.io.IOException
public void endNonEscaping() throws org.xml.sax.SAXException
org.xml.sax.SAXException
startNonEscaping()
public void startNonEscaping() throws org.xml.sax.SAXException
The contents of the un-escaping section will be delivered through the regular characters event.
org.xml.sax.SAXException
protected void cdata(char[] ch, int start, int length) throws org.xml.sax.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.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.
org.xml.sax.SAXException
ignorableWhitespace(char[], int, int)
,
Locator
protected void charactersRaw(char[] ch, int start, int length) throws org.xml.sax.SAXException
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
org.xml.sax.SAXException
public void characters(char[] chars, int start, int length) throws org.xml.sax.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.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.
org.xml.sax.SAXException
ignorableWhitespace(char[], int, int)
,
Locator
public void characters(java.lang.String s) throws org.xml.sax.SAXException
s
- The string of characters to process.
org.xml.sax.SAXException
protected int accumDefaultEscape(java.io.Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws java.io.IOException
ch
- character to be escaped.i
- index into character array.chars
- non-null reference to character array.len
- length of chars.fromTextNode
- true if the characters being processed are
from a text node, false if the characters being processed are from
an attribute value.escLF
- true if the linefeed should be escaped.
org.xml.sax.SAXException
java.io.IOException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
namespaceURI
- The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.name
- The element type name.atts
- The attributes attached to the element, if any.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.
org.xml.sax.SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
,
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
,
AttributeList
public void startElement(java.lang.String elementNamespaceURI, java.lang.String elementLocalName, java.lang.String elementName) throws org.xml.sax.SAXException
elementNamespaceURI
- The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.elementLocalName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.elementName
- The element type name.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.
org.xml.sax.SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
,
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
,
AttributeList
public void startElement(java.lang.String elementName) throws org.xml.sax.SAXException
elementName
- the fully qualified name of the element
org.xml.sax.SAXException
public void processAttributes(java.io.Writer writer, int nAttrs) throws java.io.IOException, org.xml.sax.SAXException
writer
- the writer to write processed attributes to.nAttrs
- the number of attributes in m_attributes
to be processed
java.io.IOException
org.xml.sax.SAXException
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.
java.io.IOException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name) throws org.xml.sax.SAXException
namespaceURI
- The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.name
- The element type name
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.
org.xml.sax.SAXException
public void endElement(java.lang.String name) throws org.xml.sax.SAXException
name
- The element type name
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
prefix
- The Namespace prefix being declared.uri
- The Namespace URI the prefix is mapped to.
org.xml.sax.SAXException
- The client may throw
an exception during processing.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)
public boolean startPrefixMapping(java.lang.String prefix, java.lang.String uri, boolean shouldFlush) throws org.xml.sax.SAXException
prefix
- The Namespace prefix being declared.uri
- The Namespace URI the prefix is mapped to.shouldFlush
- true if any open tags need to be closed first, this
will impact which element the mapping applies to (open parent, or its up
comming child)
org.xml.sax.SAXException
- The client may throw
an exception during processing.ExtendedContentHandler.startPrefixMapping(java.lang.String, java.lang.String, boolean)
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
ch
- An array holding the characters in the comment.start
- The starting position in the array.length
- The number of characters to use from the array.
org.xml.sax.SAXException
- The application may raise an exception.public void endCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- The application may raise an exception.startCDATA()
public void endDTD() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- The application may raise an exception.startDTD(java.lang.String, java.lang.String, java.lang.String)
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
prefix
- The prefix that was being mapping.
org.xml.sax.SAXException
- The client may throw
an exception during processing.ContentHandler.endPrefixMapping(java.lang.String)
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.
org.xml.sax.SAXException
characters(char[], int, int)
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
name
- The name of the skipped entity. If it is a
parameter entity, the name will begin with '%',
and if it is the external DTD subset, it will be the string
"[dtd]".
org.xml.sax.SAXException
- Any SAX exception, possibly wrapping
another exception.ContentHandler.skippedEntity(java.lang.String)
public void startCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- The application may raise an exception.endCDATA()
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
name
- The name of the entity. If it is a parameter
entity, the name will begin with '%'.
org.xml.sax.SAXException
- The application may raise an exception.SerializerBase.endEntity(java.lang.String)
,
DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)
,
DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
protected void closeStartTag() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
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.
org.xml.sax.SAXException
- The application may raise an
exception.endDTD()
,
startEntity(java.lang.String)
public int getIndentAmount()
getIndentAmount
in class SerializerBase
public void setIndentAmount(int m_indentAmount)
setIndentAmount
in interface SerializationHandler
setIndentAmount
in class SerializerBase
m_indentAmount
- The m_indentAmount to setprotected boolean shouldIndent()
public void setCdataSectionElements(java.util.Vector URI_and_localNames)
URI_and_localNames
- a vector of pairs of Strings (URI/local)protected java.lang.String ensureAttributesNamespaceIsDeclared(java.lang.String ns, java.lang.String localName, java.lang.String rawName) throws org.xml.sax.SAXException
ns
- the namespace URIrawName
- the qualified name
org.xml.sax.SAXException
public void flushPending() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void setContentHandler(org.xml.sax.ContentHandler ch)
SerializationHandler
Serializer.asContentHandler()
,
ToSAXHandler
public boolean addAttributeAlways(java.lang.String uri, java.lang.String localName, java.lang.String rawName, java.lang.String type, java.lang.String value, boolean xslAttribute)
addAttributeAlways
in class SerializerBase
uri
- the URI of the attributelocalName
- the local name of the attributerawName
- the qualified name of the attributetype
- the type of the attribute (probably CDATA)value
- the value of the attributexslAttribute
- true if this attribute is coming from an xsl:attribute element.
protected void firePseudoAttributes()
public void setTransformer(javax.xml.transform.Transformer transformer)
SerializerBase
setTransformer
in interface SerializationHandler
setTransformer
in class SerializerBase
transformer
- the transformer associated with this serializer.SerializationHandler.setTransformer(Transformer)
public boolean reset()
reset
in interface Serializer
reset
in class SerializerBase
public void setEncoding(java.lang.String encoding)
setEncoding
in class SerializerBase
encoding
- the character encodingpublic void notationDecl(java.lang.String name, java.lang.String pubID, java.lang.String sysID) throws org.xml.sax.SAXException
notationDecl
in interface org.xml.sax.DTDHandler
notationDecl
in class SerializerBase
org.xml.sax.SAXException
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)
public void unparsedEntityDecl(java.lang.String name, java.lang.String pubID, java.lang.String sysID, java.lang.String notationName) throws org.xml.sax.SAXException
unparsedEntityDecl
in interface org.xml.sax.DTDHandler
unparsedEntityDecl
in class SerializerBase
org.xml.sax.SAXException
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void setDTDEntityExpansion(boolean expand)
setDTDEntityExpansion
in interface SerializationHandler
setDTDEntityExpansion
in class SerializerBase
expand
- true if DTD entities are to be expanded,
false if they are to be left as DTD entity references.public void addUniqueAttribute(java.lang.String qName, java.lang.String value, int flags) throws org.xml.sax.SAXException
qName
- the fully qualified attribute name.value
- the attribute valueflags
- a bitwise flag
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |