Package org.mybatis.generator.internal
Class DomWriter
java.lang.Object
org.mybatis.generator.internal.DomWriter
This class is used to generate a String representation of an XML document. It
is very much based on the class dom.Writer from the Apache Xerces examples,
but I've simplified and updated it.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetVersion(Document document) Extracts the XML version from the Document.private voidprivate voidprivate voidhandleDefault(char c, boolean isAttValue) private voidhandleDoubleQuote(boolean isAttValue) private voidprivate voidprivate voidprotected voidnormalizeAndPrint(char c, boolean isAttValue) protected voidnormalizeAndPrint(String s, boolean isAttValue) protected Attr[]sortAttributes(NamedNodeMap attrs) protected voidwrite(CDATASection node) protected voidprotected voidprotected voidwrite(DocumentType node) protected voidprotected voidwrite(EntityReference node) protected voidwrite(ProcessingInstruction node) protected voidprotected voidwriteAnyNode(Node node)
-
Field Details
-
printWriter
-
isXML11
protected boolean isXML11
-
-
Constructor Details
-
DomWriter
public DomWriter()
-
-
Method Details
-
toString
- Throws:
ShellException
-
sortAttributes
-
normalizeAndPrint
-
normalizeAndPrint
protected void normalizeAndPrint(char c, boolean isAttValue) -
handleDefault
private void handleDefault(char c, boolean isAttValue) -
handleLineFeed
private void handleLineFeed() -
handleCarriageReturn
private void handleCarriageReturn() -
handleDoubleQuote
private void handleDoubleQuote(boolean isAttValue) -
handleAmpersand
private void handleAmpersand() -
handleGreaterThan
private void handleGreaterThan() -
handleLessThan
private void handleLessThan() -
getVersion
Extracts the XML version from the Document.- Parameters:
document- the document- Returns:
- the version
-
writeAnyNode
- Throws:
ShellException
-
write
- Throws:
ShellException
-
write
-
write
- Throws:
ShellException
-
write
-
write
-
write
-
write
-
write
-