com.openharbor.beck.write
Class DefaultXMLWriter
java.lang.Object
java.io.Writer
com.openharbor.beck.write.XMLWriter
com.openharbor.beck.write.FastXMLWriter
com.openharbor.beck.write.DefaultXMLWriter
- public class DefaultXMLWriter
- extends FastXMLWriter
Output XML with line breaks and indentation (making it easy to read).
Fields inherited from class java.io.Writer |
lock |
Methods inherited from class com.openharbor.beck.write.XMLWriter |
attributes, getDocumentState, getElementStack, getElementStackTop, namespace, namespace, newMapKey, prefixToNamespace, resolveNamespace, setDocumentState, startElement |
Methods inherited from class java.io.Writer |
write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultXMLWriter
public DefaultXMLWriter(java.io.Writer out)
getLineSeparator
public java.lang.String getLineSeparator()
- The character sequence that indicates the end of a line.
setLineSeparator
public void setLineSeparator(java.lang.String lineSeparator)
getIndentation
public int getIndentation()
- The number of spaces to add to the left margin, to indicate nested elements.
setIndentation
public void setIndentation(int indentation)
indent
protected void indent(int stops)
writeMargin
protected void writeMargin()
throws java.io.IOException
- Throws:
java.io.IOException
xmlHeader
public void xmlHeader(java.lang.String encoding)
throws java.io.IOException
- Description copied from class:
FastXMLWriter
- Write <?xml version="1.0" sax...
- Overrides:
xmlHeader
in class FastXMLWriter
- Throws:
java.io.IOException
documentType
public void documentType(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws java.io.IOException
- Description copied from class:
FastXMLWriter
- Write <!DOCTYPE sax...
- Overrides:
documentType
in class FastXMLWriter
- Parameters:
name
- document type namepublicId
- public ID, or null to omit the public ID declaration.
- Throws:
java.io.IOException
startElement
protected void startElement(XMLName name)
throws java.io.IOException
- Overrides:
startElement
in class FastXMLWriter
- Throws:
java.io.IOException
endElement
public void endElement()
throws java.io.IOException
- Overrides:
endElement
in class FastXMLWriter
- Throws:
java.io.IOException