|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.ibm.dom.util.NOOPVisitor
|
+--com.ibm.dom.util.ToXMLVisitor
TreeTraversal,
com.ibm.xml.parser.ToXMLStringVisitor| Field Summary | |
protected java.lang.String |
encoding
|
protected boolean |
isPrintNonSpecifiedAttributes
|
protected java.io.Writer |
writer
|
| Constructor Summary | |
ToXMLVisitor(java.io.Writer writer)
Constructor for default encoding. |
|
ToXMLVisitor(java.io.Writer writer,
java.lang.String encoding)
Constructor for customized encoding. |
|
| Method Summary | |
void |
escapedWrite(java.io.Writer writer,
java.lang.String string,
java.lang.String encoding)
Writes the specified string to specified Writer after substituting &, <, >,
, and UTF-16 surrogates for the set of entitiy references
(&, <, >) and numeric character
references (&#...) respectively. |
void |
escapedWrite(java.io.Writer writer,
java.lang.String string,
java.lang.String specials,
java.lang.String encoding)
Returns the specified string after substituting specials, and UTF-16 surrogates for chracter references &#xnn. |
boolean |
getPrintNonSpecifiedAttributes()
Returns whether this prints non-specified default attributes appended by DTD. |
void |
setPrintNonSpecifiedAttributes(boolean print)
Sets whether this prints non-specified default attributes appended by DTD. |
void |
visitAttributePre(Attr attribute)
Creates a string representation of the specified attribute Node in XML format. |
void |
visitCDATASectionPre(CDATASection cdata)
Creates a string representation of the specified cdata Node in XML format. |
void |
visitCommentPre(Comment comment)
Creates a string representation of the specified comment Node in XML format. |
void |
visitDocumentPost(Document document)
Flush the writer. |
void |
visitDocumentPre(Document document)
Creates a string representation of the specified document Node in XML format. |
void |
visitDocumentTypePre(DocumentType doctype)
Creates a string representation of the specified doctype Node in XML format. |
void |
visitElementPost(Element element)
Creates a string representation of the end of the specified element Node in XML format. |
void |
visitElementPre(Element element)
Creates a string representation of the start of the specified element Node and its associated attributes in XML format. |
void |
visitEntityReference(EntityReference ref)
Creates a string representation of the specified ref Node in XML format. |
void |
visitProcessingInstructionPre(ProcessingInstruction pi)
Creates a string representation of the specified pi Node in XML format. |
void |
visitTextPre(Text text)
Creates a string representation of the specified text Node in XML format. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.io.Writer writer
protected java.lang.String encoding
protected boolean isPrintNonSpecifiedAttributes
| Constructor Detail |
public ToXMLVisitor(java.io.Writer writer,
java.lang.String encoding)
writer - The character output stream to use. This MUST be UTF-8 or UTF-16 Writer.encoding - Java character encoding in use by writer.public ToXMLVisitor(java.io.Writer writer)
writer - The character output stream to use. This MUST be UTF-8 or UTF-16 Writer.| Method Detail |
public void setPrintNonSpecifiedAttributes(boolean print)
By default, non-specified attributes are printed.
Attr.getSpecified()public boolean getPrintNonSpecifiedAttributes()
public void visitDocumentPre(Document document)
throws java.lang.Exception
document - Node toString in XML format.
public void visitDocumentPost(Document document)
throws java.lang.Exception
document - Not used.
public void visitElementPre(Element element)
throws java.lang.Exception
element - Node toString in XML format.
public void visitElementPost(Element element)
throws java.lang.Exception
element - Node toString in XML format.
public void visitAttributePre(Attr attribute)
throws java.lang.Exception
attribute - Node toString in XML format.
public void visitProcessingInstructionPre(ProcessingInstruction pi)
throws java.lang.Exception
pi - Node toString in XML format.
public void visitCommentPre(Comment comment)
throws java.lang.Exception
comment - Node toString in XML format.
public void visitTextPre(Text text)
throws java.lang.Exception
text - Node toString in XML format.
public void visitCDATASectionPre(CDATASection cdata)
throws java.lang.Exception
cdata - Node toString in XML format.
public void visitDocumentTypePre(DocumentType doctype)
throws java.lang.Exception
doctype - Node toString in XML format.
public void visitEntityReference(EntityReference ref)
throws java.lang.Exception
ref - Node toString in XML format.
public void escapedWrite(java.io.Writer writer,
java.lang.String string,
java.lang.String encoding)
throws java.io.IOException
&, <, >,
, and UTF-16 surrogates for the set of entitiy references
(&, <, >) and numeric character
references (&#...) respectively.writer - Writer for output. Buffered writer is recommended.string - String to convert to XML format.encoding - CURRENTLY NOT IMPLEMENTED.
public void escapedWrite(java.io.Writer writer,
java.lang.String string,
java.lang.String specials,
java.lang.String encoding)
throws java.io.IOException
&#xnn.writer - Writer for output. Buffered writer is recommended.string - String to convert to XML format.specials - Chracters, should be represeted in chracter referenfces.encoding - CURRENTLY NOT IMPLEMENTED.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||