Modifier and Type | Class and Description |
---|---|
pack-priv static class | ToStream.
Simple stack for boolean values. |
private class | ToStream.
This inner class is used to buffer the text nodes and the entity reference nodes if indentation is on. |
private class | ToStream.
This inner class is used only to collect attribute values written by the method writeAttrString() into a string buffer. |
Modifier and Type | Field and Description |
---|---|
private static final String | |
private static final String | |
pack-priv Method | m_canConvertMeth
Method reference to the sun.io.CharToByteConverter#canConvert method for this encoding. |
protected boolean | m_cdataStartCalled
remembers if we are in between the startCDATA() and endCDATA() callbacks |
protected ToStream. | m_charactersBuffer
Used to buffer the text nodes and the entity reference nodes if indentation is on. |
protected CharInfo | m_charInfo
Map that tells which characters should have special treatment, and it provides character to entity name lookup. |
pack-priv Object | m_charToByteConverter
Opaque reference to the sun.io.CharToByteConverter for this encoding. |
protected int | |
protected List | m_childNodeNumStack
Used to decide if a text node is pretty-printed with indentation. |
protected ToStream. | m_disableOutputEscapingStates
Stack to keep track of disabling output escaping. |
pack-priv EncodingInfo | m_encodingInfo
The encoding information associated with this serializer. |
private boolean | m_escaping
Taken from XSLTC |
private boolean | m_expandDTDEntities
If this flag is true DTD entity references are not left as-is, which is exiting older behavior. |
private char | |
protected boolean | m_inDoctype
Tells if we're in an internal document type subset. |
protected boolean | |
protected boolean | m_isprevtext
State flag that tells if the previous node processed was text, so we can tell if we should preserve whitespace. |
pack-priv boolean | m_isUTF8
Flag to quickly tell if the encoding is UTF8. |
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 int | m_maxCharacter
The maximum character size before we have to resort to escaping. |
pack-priv OutputStream | |
protected ToStream. | m_preserveSpaces
Used to handle xml:space attribute |
pack-priv boolean | m_shouldFlush
True if we control the buffer, and we should flush the output on endDocument. |
protected boolean | m_spaceBeforeClose
Add space before '/>' for XHTML. |
pack-priv boolean | m_startNewLine
Flag to signal that a newline should be added. |
pack-priv boolean | m_triedToGetConverter
Boolean that tells if we already tried to get the converter. |
private boolean |
Access | Constructor and Description |
---|---|
public | |
public |
Modifier and Type | Method and Description |
---|---|
protected int | Returns: i+1 if the character was written, else i.character to be escaped. ch, int index into character array. i, char[] non-null reference to character array. chars, int length of chars. len, boolean true if the characters being processed
are from a text node, false if they are from an attribute value fromTextNode, boolean true if the linefeed should be escaped. escLF)Handle one of the default entities, return false if it is not a default entity. |
protected int | Returns: i+1 if a character was written, i+2 if two characters were written out, else return i.character to be escaped. ch, int index into character array. i, char[] non-null reference to character array. chars, int length of chars. len, boolean true if the characters being processed are
from a text node, false if the characters being processed are from
an attribute value. fromTextNode, boolean true if the linefeed should be escaped. escLF)Escape and writer.write a character. |
public boolean | Returns: true if the attribute value was added, false if the attribute already existed and the value was replaced with the new value.the URI of the attribute uri, String the local name of the attribute localName, String the qualified name of the attribute rawName, String the type of the attribute (probably CDATA) type, String the value of the attribute value, boolean true if this attribute is coming from an xsl:attribute element. xslAttribute)Overrides com. Adds the given attribute to the set of attributes, even if there is no currently open element. |
private void | Returns: a QName objectString of the form "{uri}local" or "local" URI_and_localName, List<String> al)Adds a URI/LocalName pair of strings to the list. |
public void | addCdataSectionElements(String
a whitespace separated list of element names, each element
is a URI in curly braces (optional) and a local name. An example of such a parameter is:
"{http://company.com}price {myURI2}book chapter" URI_and_localNames)Remembers the cdata sections specified in the cdata-section-elements by appending the given cdata section elements to the list. |
public void | attributeDecl(String
The name of the associated element. eName, String The name of the attribute. aName, String A string representing the attribute type. type, String A string representing the attribute default
("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
none of these applies. valueDefault, String A string representing the attribute's default value,
or null if there is none. value)Implements org. Report an attribute type declaration. |
protected void | cdata(char[]
The characters from the XML document. ch, int The start position in the array. start, final int The number of characters to read from the array. length)Receive notification of cdata. |
public void | characters(final char[]
The characters from the XML document. chars, final int The start position in the array. start, final int The number of characters to read from the array. length)Implements org. Receive notification of character data. |
public void | characters(String
The string of characters to process. s)Implements com. Receive notification of character data. |
protected void | charactersRaw(char[]
The characters from the XML document. ch, int The start position in the array. start, int The number of characters to read from the array. length)If available, when the disable-output-escaping attribute is used, output raw text without escaping. |
protected void | |
protected void | |
public void | comment(char[]
An array holding the characters in the comment. ch, int The starting position in the array. start, int The number of characters to use from the array. length)Implements org. Receive notification of an XML comment anywhere in the document. |
private boolean | |
private void | |
public void | elementDecl(String
The element type name. name, String The content model as a normalized string. model)Implements org. Report an element type declaration. |
public void | |
public void | |
public void | endElement(String
The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed. namespaceURI, String The local name (without prefix), or the
empty string if Namespace processing is not being
performed. localName, String The element type name name)Implements org. Receive notification of the end of an element. |
public void | endElement(String
The element type name name)Implements com. Receive notification of the end of an element. |
public void | |
public void | endPrefixMapping(String
The prefix that was being mapping. prefix)Implements org. End the scope of a prefix-URI Namespace mapping. |
protected String | Returns: returns null if no action is taken, otherwise it returns the prefix used in declaring the namespace.the namespace URI ns, String localName, String the qualified name rawName)Makes sure that the namespace URI for the given qualified attribute name is declared. |
pack-priv void | |
protected boolean | |
public void | externalEntityDecl(String
The name of the entity. If it is a parameter
entity, the name will begin with '%'. name, String The declared public identifier of the entity, or
null if none was declared. publicId, String The declared system identifier of the entity. systemId)Implements org. Report a parsed external entity declaration. |
protected void | |
protected final void | flushCharactersBuffer(boolean
indicates whether the node to be traversed is text isText)Flushes the buffered characters when indentation is on. |
public void | flushPending()
Implements com. This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section. |
protected final void | |
public boolean | Returns: True if the content in current element should be formatted.Overrides com. Implements com.
|
public int | Returns: intOverrides com. Implements com. Returns the m_indentAmount. |
public Properties | Returns: The output format in useImplements com. Returns the output format for this serializer. |
public OutputStream | Returns: reference to the result stream, or null of only a writer was set.Implements com. Get the output stream where the events will be serialized to. |
public Writer | Returns: Reference to the result Writer, or null.Implements com. Get the character stream where the events will be serialized to. |
private int | Returns: the next indexthe current char c, char[] the character array ch, int the current position i, int the end index of the array end)Handles escaping, writes either with a surrogate pair or a character reference. |
public void | ignorableWhitespace(char[]
The characters from the XML document. ch, int The start position in the array. start, int The number of characters to read from the array. length)Implements org. Receive notification of ignorable whitespace in element content. |
protected void | indent(int
the indentation depth (element nesting depth) depth)Might print a newline character and the indentation amount of the given depth. |
protected void | |
public void | internalEntityDecl(String
The name of the entity. If it is a parameter
entity, the name will begin with '%'. name, String The replacement text of the entity. value)Implements org. Report an internal entity declaration. |
private static boolean | Returns: booleanThis method checks if a given character is between C0 or C1 range of Control characters. |
private boolean | Returns: true if the character escaping should be disabled.Tell if the character escaping should be disabled for the current state. |
private static boolean | Returns: booleanThis method checks if a given character either NEL (0x85) or LSEP (0x2028) These are new end of line charcters added in XML 1.1. |
pack-priv static final boolean | |
public void | notationDecl(String
The notation name. name, String The notation's public identifier, or null if
none was given. pubID, String The notation's system identifier, or null if
none was given. sysID)Overrides com. Implements org. If this method is called, the serializer is used as a DTDHandler, which changes behavior how the serializer handles document entities. |
private void | outputCharacters(final char[]
The characters of the text. chars, final int The start position in the char array. start, final int The number of characters from the char array. length)Write out the characters. |
pack-priv void | outputDocTypeDecl(String
non-null reference to document type name.
NEEDSDOC @param closeDecl name, boolean closeDecl)Output the doc type declaration. |
pack-priv void | outputEntityDecl(String
non-null reference to document type name.
NEEDSDOC @param value name, String value)Output the doc type declaration. |
private void | outputEntityReference(String
The name of the entity. name)Write out the entity reference with the form as "&entityName;". |
protected final void | |
private void | |
public void | processAttributes(Writer
the writer to write processed attributes to. writer, int the number of attributes in m_attributes
to be processed nAttrs)Process the attributes, which means to write out the currently collected attributes to the writer. |
private int | Returns: the index of the last character processedarray of characters being processed chars, int one (1) beyond the last character
in chars to be processed end, int the index of the dirty character i, char the character in chars[i] ch, int the last dirty character previous to i lastDirty, boolean true if the characters being processed are
from a text node, false if they are from an attribute value. fromTextNode)Process a dirty character and any preeceding clean characters that were not yet processed. |
public boolean | Returns: true if the class was successfuly reset.Overrides com. Implements com. 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). |
private void | |
public void | serialize(Node
Node to serialize. node)Implements com. Serializes the DOM node. |
private void | setCdataSectionElements(String
the property key. key, Properties the list of properties to search in.
Sets the ArrayList of local-name/URI pairs of the cdata section elements
specified in the cdata-section-elements property.
This method is essentially a copy of getQNameProperties() from
OutputProperties. Eventually this method should go away and a call
to setCdataSectionElements(List props)Searches for the list of qname properties with the specified key in the property list. |
public void | setCdataSectionElements(List<String>
an ArrayList of pairs of Strings (URI/local) URI_and_localNames)Implements com. Remembers the cdata sections specified in the cdata-section-elements. |
public void | setContentHandler(ContentHandler ch)
Implements com. Set the SAX Content handler that the serializer sends its output to. |
public void | setDTDEntityExpansion(boolean
true if DTD entities are to be expanded,
false if they are to be left as DTD entity references. expand)Overrides com. Implements com. If set to false the serializer does not expand DTD entities, but leaves them as is, the default value is true; |
public void | setEncoding(String
the character encoding encoding)Overrides com. Implements com. Sets the character encoding coming from the xsl:output encoding stylesheet attribute. |
public boolean | setEscaping(boolean
true if escaping is to be set on. escape)Implements com. Turns special character escaping on/off. |
public void | setIndentAmount(int
The m_indentAmount to set m_indentAmount)Overrides com. Implements com. Sets the m_indentAmount. |
public boolean | Returns: The previously set value of the serializer.True if an input NL is replaced with the
operating systems end-of-line separator. use_sytem_line_break)Set if the operating systems end-of-line line separator should be used when serializing. |
public void | setOutputFormat(Properties
The output format to use format)Implements com. Specifies an output format for this serializer. |
public void | setOutputStream(OutputStream
The output stream output)Implements com. Specifies an output stream to which the document should be serialized. |
private void | |
pack-priv void | setProp(String
The name of the property, e.g. "{http://myprop}indent-tabs" or "indent". name, String The value of the property, e.g. "4" val, boolean true if this is a default value being set for the property as
opposed to a user define on, set say explicitly in the stylesheet or via JAXP defaultVal)Overrides com.
|
public void | setTransformer(Transformer
the transformer associated with this serializer. transformer)Overrides com. Implements com. Sets the transformer associated with this serializer |
public void | setWriter(Writer
The output writer stream writer)Implements com. Specifies a writer to which the document should be serialized. |
private void | |
protected boolean | Returns: True if the content should be formatted.This method checks if the content in current element should be formatted. |
protected boolean | Returns: True if an indent should occur.Tell if, based on space preservation constraints and the doIndent property, if an indent should occur. |
protected boolean | |
public void | skippedEntity(String
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]". name)Implements org. Receive notification of a skipped entity. |
public void | startCDATA()
Implements org. Report the start of a CDATA section. |
public void | startDTD(String
The document type name. name, String The declared public identifier for the
external DTD subset, or null if none was declared. publicId, String The declared system identifier for the
external DTD subset, or null if none was declared. systemId)Implements org. Report the start of DTD declarations, if any. |
public void | startElement(String
The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed. namespaceURI, String The local name (without prefix), or the
empty string if Namespace processing is not being
performed. localName, String The element type name. name, Attributes The attributes attached to the element, if any. atts)Implements org. 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. |
public void | startElement(String
The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed. elementNamespaceURI, String The local name (without prefix), or the
empty string if Namespace processing is not being
performed. elementLocalName, String The element type name. elementName)Implements com. 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. |
public void | startElement(String
the fully qualified name of the element elementName)Implements com. This method is used to notify of the start of an element |
public void | startEntity(String
The name of the entity. If it is a parameter
entity, the name will begin with '%'. name)Implements org. Report the beginning of an entity. |
public void | |
public void | startPrefixMapping(String
The Namespace prefix being declared. prefix, String The Namespace URI the prefix is mapped to. uri)Implements org. Begin the scope of a prefix-URI Namespace mapping just before another element is about to start. |
public boolean | Returns: returns true if the call made a change to the current namespace information, false if it did not change anything, e.g. if the prefix/namespace mapping was already in scope from before.The Namespace prefix being declared. prefix, String The Namespace URI the prefix is mapped to. uri, boolean 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) shouldFlush)Implements com. Handle a prefix/uri mapping, which is associated with a startElement() that is soon to follow. |
private void | |
public void | unparsedEntityDecl(String
The unparsed entity's name. name, String The entity's public identifier, or null if none
was given. pubID, String The entity's system identifier. sysID, String The name of the associated notation. notationName)Overrides com. Implements org. If this method is called, the serializer is used as a DTDHandler, which changes behavior how the serializer handles document entities. |
public void | writeAttrString(Writer writer, String
String to convert to XML format. string, String CURRENTLY NOT IMPLEMENTED. encoding)Returns the specified string after substituting specials,
and UTF-16 surrogates for chracter references |
private void | |
private int | writeCharRef(Writer
the writer writer, char the high surrogate high, char the low surrogate low)Writes out a pair of surrogates as a character reference |
pack-priv void | writeNormalizedChars(char[]
The characters from the XML document. ch, int The start position in the array. start, int The number of characters to read from the array. length, boolean true if a CDATA block should be built around the characters. isCData, boolean true if the operating systems
end-of-line separator should be output rather than a new-line character. useSystemLineSeparator)Normalize the characters, but don't escape. |
protected int | Returns: the status of writing a surrogate pair. -1 -- nothing is written 0 -- the pair is written as-is code point -- the pair is written as an entity referencethe first (high) part of the surrogate, which
must be confirmed before calling this method. c, char[] Character array. ch, int position Where the surrogate was detected. i, int The end index of the significant characters. 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. |