Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private static final ElemDesc | m_dummy
Dummy element for elements not found. |
pack-priv static final ToHTMLStream. | m_elementFlags
A digital search trie for fast, case insensitive lookup of ElemDesc objects. |
private static final CharInfo | m_htmlcharInfo
Map that tells which XML characters should have special treatment, and it provides character to entity name lookup. |
private ToHTMLStream. | m_htmlInfo
A Trie that is just a copy of the "static" one. |
protected boolean | m_inDTD
This flag is set while receiving events from the DTD |
private boolean | m_isprevblock
True if the previous element is a block element. |
private boolean | m_omitMetaTag
True if the META tag should be omitted. |
private boolean | m_specialEscapeURLs
True if URLs should be specially escaped with the %xx form. |
Access | Constructor and Description |
---|---|
public | |
public |
Modifier and Type | Method and Description |
---|---|
public void | addUniqueAttribute(String
the qualified name of the attribute name, String the value of the attribute which can contain only
ASCII printable characters characters in the range 32 to 127 inclusive. value, int the bit values of this integer give optimization information. flags)Implements com. This method is used to add an attribute to the currently open element. |
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)Overrides com. Implements org. This method does nothing. |
public final void | cdata(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)Overrides com. Receive notification of cdata. |
public final void | characters(char[]
The characters from the XML document. chars, int The start position in the array. start, int The number of characters to read from the array. length)Overrides com. Implements org. Receive notification of character data. |
protected void | closeStartTag()
Overrides com. For the enclosing elements starting tag write out out any attributes followed by ">" |
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)Overrides com. Implements org. Receive notification of an XML comment anywhere in the document. |
public void | elementDecl(String
The element type name. name, String The content model as a normalized string. model)Overrides com. Implements org. This method does nothing. |
public final void | endDocument()
Implements org. Receive notification of the end of a document. |
public void | endDTD()
Overrides com. Implements org. Report the end of DTD declarations. |
public final void | endElement(final String namespaceURI, final String localName, final String
The element type name name)Overrides com. Implements org. Receive notification of the end of an element. |
public final void | endElement(String
The element type name elemName)Overrides com. Implements com. Receive notification of the end of an element. |
public final void | entityReference(String
non-null reference to entity name string. name)Overrides com. Implements com. Receive notivication of a entityReference. |
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)Overrides com. Implements org. This method does nothing. |
public static final ElemDesc | Returns: non-null reference to ElemDesc, which may be m_dummy if no element description matches the given name.non-null name of element, case insensitive. name)Get a description of the given element. |
private ElemDesc | getElemDesc2(String name)
Calls to this method could be replaced with calls to getElemDesc(name), but this one should be faster. |
private final boolean | Returns: True if the META tag should be omitted.Tells if the formatter should omit the META tag. |
private final boolean | Returns: True if URLs should be specially escaped with the %xx form.Tells if the formatter should use special URL escaping. |
pack-priv static void | |
private 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)Overrides com. Implements org. This method does nothing. |
private boolean | |
private boolean | |
private static String | Returns: should be a two character string.must be a value less than 255. i)Make an integer into an HH hex value. |
public void | namespaceAfterStartElement(String
the prefix associated with the given URI. prefix, String the URI of the namespace uri)Overrides com. Implements com. This method is used when a prefix/uri namespace mapping is indicated after the element was started with a startElement() and before and endElement(). |
protected void | processAttribute(Writer
The writer to write the processed output to. writer, String The name of the attribute. name, String The value of the attribute. value, ElemDesc The description of the HTML element
that has this attribute. elemDesc)Process an attribute. |
public void | processAttributes(Writer
the writer to write processed attributes to. writer, int the number of attributes in m_attributes
to be processed nAttrs)Overrides com. Process the attributes, which means to write out the currently collected attributes to the writer. |
public void | processingInstruction(String
The processing instruction target. target, String The processing instruction data, or null if
none was supplied. data)Implements org. Receive notification of a processing instruction. |
public boolean | 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). |
public void | setOmitMetaTag(boolean
True if the META tag should be omitted. bool)Tells if the formatter should omit the META tag. |
public void | setOutputFormat(Properties
The output format or serialzation parameters
to use. format)Overrides com. Implements com. Specifies an output format for this serializer. |
public void | setSpecialEscapeURLs(boolean
True if URLs should be specially escaped with the %xx form. bool)Tells if the formatter should use special URL escaping. |
protected boolean | Returns: True if the content should be formatted.Overrides com. Only check m_doIndent, disregard m_ispreserveSpace. |
protected boolean | shouldIndentForText()
Overrides com. If the previous is an inline element, won't insert a new line before the text. |
protected void | startDocumentInternal()
Overrides com. Receive notification of the beginning of a document. |
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)Overrides com. Implements org. Report the start of DTD declarations, if any. |
public void | startElement(String namespaceURI, String localName, String
The element type name. name, Attributes The attributes attached to the element, if any. atts)Overrides com. Implements org. Receive notification of the beginning of an element. |
public void | writeAttrString(final Writer writer, String
String to convert to XML format. string, String CURRENTLY NOT IMPLEMENTED. encoding)Overrides com. Writes the specified string after substituting specials,
and UTF-16 surrogates for character references |
public void | writeAttrURI(final Writer writer, String
String to convert to XML format. string, boolean True if we should try to encode as
per http://www.ietf.org/rfc/rfc2396.txt. doURLEscaping)Write the specified string after substituting non ASCII characters,
with |
m_dummy | back to summary |
---|---|
private static final ElemDesc m_dummy Dummy element for elements not found. |
m_elementFlags | back to summary |
---|---|
pack-priv static final ToHTMLStream. A digital search trie for fast, case insensitive lookup of ElemDesc objects. |
m_htmlcharInfo | back to summary |
---|---|
private static final CharInfo m_htmlcharInfo Map that tells which XML characters should have special treatment, and it provides character to entity name lookup. |
m_htmlInfo | back to summary |
---|---|
private ToHTMLStream. A Trie that is just a copy of the "static" one. We need this one to be able to use the faster, but not thread-safe method Trie.get2(name) |
m_inDTD | back to summary |
---|---|
protected boolean m_inDTD This flag is set while receiving events from the DTD |
m_isprevblock | back to summary |
---|---|
private boolean m_isprevblock True if the previous element is a block element. |
m_omitMetaTag | back to summary |
---|---|
private boolean m_omitMetaTag True if the META tag should be omitted. |
m_specialEscapeURLs | back to summary |
---|---|
private boolean m_specialEscapeURLs True if URLs should be specially escaped with the %xx form. |
ToHTMLStream | back to summary |
---|---|
public ToHTMLStream() Default constructor. |
ToHTMLStream | back to summary |
---|---|
public ToHTMLStream(ErrorListener l) |
addUniqueAttribute | back to summary |
---|---|
public void addUniqueAttribute(String name, String value, int flags) throws SAXException Implements com. 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. |
attributeDecl | back to summary |
---|---|
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException Overrides com. Implements org. This method does nothing.
|
cdata | back to summary |
---|---|
public final void cdata(char[] ch, int start, int length) throws SAXException Overrides com. 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).
|
characters | back to summary |
---|---|
public final void characters(char[] chars, int start, int length) throws SAXException Overrides com. Implements org. 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).
|
closeStartTag | back to summary |
---|---|
protected void closeStartTag() throws SAXException Overrides com. For the enclosing elements starting tag write out out any attributes followed by ">" |
comment | back to summary |
---|---|
public void comment(char[] ch, int start, int length) throws SAXException Overrides com. Implements org. Doc from com. 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).
|
elementDecl | back to summary |
---|---|
public void elementDecl(String name, String model) throws SAXException Overrides com. Implements org. This method does nothing.
|
endDocument | back to summary |
---|---|
public final void endDocument() throws SAXException Implements org. Receive notification of the end of a document.
|
endDTD | back to summary |
---|---|
public void endDTD() throws SAXException Overrides com. Implements org. Report the end of DTD declarations.
|
endElement | back to summary |
---|---|
public final void endElement(final String namespaceURI, final String localName, final String name) throws SAXException Overrides com. Implements org. Receive notification of the end of an element.
|
endElement | back to summary |
---|---|
public final void endElement(String elemName) throws SAXException Overrides com. Implements com. Doc from com. Receive notification of the end of an element.
|
entityReference | back to summary |
---|---|
public final void entityReference(String name) throws SAXException Overrides com. Implements com. Receive notivication of a entityReference.
|
externalEntityDecl | back to summary |
---|---|
public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException Overrides com. Implements org. This method does nothing.
|
getElemDesc | back to summary |
---|---|
public static final ElemDesc getElemDesc(String name) Get a description of the given element. |
getElemDesc2 | back to summary |
---|---|
private ElemDesc getElemDesc2(String name) Calls to this method could be replaced with calls to getElemDesc(name), but this one should be faster. |
getOmitMetaTag | back to summary |
---|---|
private final boolean getOmitMetaTag() Tells if the formatter should omit the META tag.
|
getSpecialEscapeURLs | back to summary |
---|---|
private final boolean getSpecialEscapeURLs() Tells if the formatter should use special URL escaping.
|
initTagReference | back to summary |
---|---|
pack-priv static void initTagReference(ToHTMLStream. |
initToHTMLStream | back to summary |
---|---|
private void initToHTMLStream() |
internalEntityDecl | back to summary |
---|---|
public void internalEntityDecl(String name, String value) throws SAXException Overrides com. Implements org. This method does nothing.
|
isASCIIDigit | back to summary |
---|---|
private boolean isASCIIDigit(char c) Tell if a character is an ASCII digit. |
isHHSign | back to summary |
---|---|
private boolean isHHSign(String str) Dmitri Ilyin: Makes sure if the String is HH encoded sign.
|
makeHHString | back to summary |
---|---|
private static String makeHHString(int i) Make an integer into an HH hex value. Does no checking on the size of the input, since this is only meant to be used locally by writeAttrURI.
|
namespaceAfterStartElement | back to summary |
---|---|
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException Overrides com. Implements com. 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.
|
processAttribute | back to summary |
---|---|
protected void processAttribute(Writer writer, String name, String value, ElemDesc elemDesc) throws IOException, SAXException Process an attribute. |
processAttributes | back to summary |
---|---|
public void processAttributes(Writer writer, int nAttrs) throws IOException, SAXException Overrides com. Process the attributes, which means to write out the currently collected attributes to the writer. The attributes are not cleared by this method
|
processingInstruction | back to summary |
---|---|
public void processingInstruction(String target, String data) throws SAXException Implements org. Receive notification of a processing instruction.
|
reset | back to summary |
---|---|
public boolean reset() Overrides com. Implements com. Doc from 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).
|
setOmitMetaTag | back to summary |
---|---|
public void setOmitMetaTag(boolean bool) Tells if the formatter should omit the META tag.
|
setOutputFormat | back to summary |
---|---|
public void setOutputFormat(Properties format) Overrides com. Implements com. 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. This method can be called multiple times before starting the serialization of a particular result-tree. In principle all serialization parameters can be changed, with the exception of method="html" (it must be method="html" otherwise we shouldn't even have a ToHTMLStream object here!)
|
setSpecialEscapeURLs | back to summary |
---|---|
public void setSpecialEscapeURLs(boolean bool) Tells if the formatter should use special URL escaping.
|
shouldFormatOutput | back to summary |
---|---|
protected boolean shouldFormatOutput() Overrides com. Only check m_doIndent, disregard m_ispreserveSpace.
|
shouldIndentForText | back to summary |
---|---|
protected boolean shouldIndentForText() Overrides com. If the previous is an inline element, won't insert a new line before the text. |
startDocumentInternal | back to summary |
---|---|
protected void startDocumentInternal() throws SAXException Overrides com. Receive notification of the beginning of a document.
|
startDTD | back to summary |
---|---|
public void startDTD(String name, String publicId, String systemId) throws SAXException Overrides com. Implements org. Doc from com. Report the start of DTD declarations, if any. Any declarations are assumed to be in the internal subset unless otherwise indicated.
|
startElement | back to summary |
---|---|
public void startElement(String namespaceURI, String localName, String name, Attributes atts) throws SAXException Overrides com. Implements org. Receive notification of the beginning of an element.
|
writeAttrString | back to summary |
---|---|
public void writeAttrString(final Writer writer, String string, String encoding) throws IOException, SAXException Overrides com. Writes the specified string after substituting specials,
and UTF-16 surrogates for character references |
writeAttrURI | back to summary |
---|---|
public void writeAttrURI(final Writer writer, String string, boolean doURLEscaping) throws IOException Write the specified string after substituting non ASCII characters,
with
|
Modifier and Type | Class and Description |
---|---|
private class | ToHTMLStream.
The node representation for the trie. |
Modifier and Type | Field and Description |
---|---|
public static final int | ALPHA_SIZE
Size of the m_nextChar array. |
private char[] | m_charBuffer
helper buffer to convert Strings to char arrays |
private final boolean | m_lowerCaseOnly
true if the search for an object is lower case only with the key |
pack-priv final ToHTMLStream. | m_Root
The root node of the tree. |
Access | Constructor and Description |
---|---|
public | |
public | Trie(boolean
true if the search keys are to be loser case only,
not case insensitive. lowerCaseOnly)Construct the trie given the desired case sensitivity with the key. |
public | Trie(ToHTMLStream.
the Trie that this one is a copy of. existingTrieConstruct the trie from another Trie. |
Modifier and Type | Method and Description |
---|---|
public Object | |
public Object | |
public int | |
public Object |
ALPHA_SIZE | back to summary |
---|---|
public static final int ALPHA_SIZE Size of the m_nextChar array. |
m_charBuffer | back to summary |
---|---|
private char[] m_charBuffer helper buffer to convert Strings to char arrays |
m_lowerCaseOnly | back to summary |
---|---|
private final boolean m_lowerCaseOnly true if the search for an object is lower case only with the key |
m_Root | back to summary |
---|---|
pack-priv final ToHTMLStream. The root node of the tree. |
Trie | back to summary |
---|---|
public Trie() Construct the trie that has a case insensitive search. |
Trie | back to summary |
---|---|
public Trie(boolean lowerCaseOnly) Construct the trie given the desired case sensitivity with the key.
|
Trie | back to summary |
---|---|
public Trie(ToHTMLStream. Construct the trie from another Trie. Both the existing Trie and this new one share the same table for lookup, and it is assumed that the table is fully populated and not changing anymore.
|
get | back to summary |
---|---|
public Object get(final String key) Get an object that matches the key. |
get2 | back to summary |
---|---|
public Object get2(final String key) Get an object that matches the key. This method is faster than get(), but is not thread-safe. |
getLongestKeyLength | back to summary |
---|---|
public int getLongestKeyLength() Get the length of the longest key used in the table. |
put | back to summary |
---|---|
public Object put(String key, Object value) Put an object into the trie for lookup. |
Modifier and Type | Field and Description |
---|---|
pack-priv final ToHTMLStream. | m_nextChar
The next nodes. |
pack-priv Object | m_Value
The value. |
Access | Constructor and Description |
---|---|
pack-priv |
m_nextChar | back to summary |
---|---|
pack-priv final ToHTMLStream. The next nodes. |
m_Value | back to summary |
---|---|
pack-priv Object m_Value The value. |
Node | back to summary |
---|---|
pack-priv Node() Constructor, creates a Node[ALPHA_SIZE]. |