com.openharbor.beck.write
Class DefaultXMLWriter

java.lang.Object
  extended byjava.io.Writer
      extended bycom.openharbor.beck.write.XMLWriter
          extended bycom.openharbor.beck.write.FastXMLWriter
              extended bycom.openharbor.beck.write.DefaultXMLWriter

public class DefaultXMLWriter
extends FastXMLWriter

Output XML with line breaks and indentation (making it easy to read).


Nested Class Summary
 
Nested classes inherited from class com.openharbor.beck.write.XMLWriter
XMLWriter.MapKey
 
Field Summary
 
Fields inherited from class com.openharbor.beck.write.FastXMLWriter
ATTRIBUTE, attributeWriter, CONTENT, contentWriter, END, out, START, state
 
Fields inherited from class com.openharbor.beck.write.XMLWriter
CYCLES, DECLARED_NAMESPACES, ELEMENT_NAME, prefixer, SOURCE, TEXT_IS_SIGNIFICANT, XSI, XSI_TYPE
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
DefaultXMLWriter(java.io.Writer out)
           
 
Method Summary
 void documentType(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Write <!DOCTYPE sax...
 void endElement()
           
 int getIndentation()
          The number of spaces to add to the left margin, to indicate nested elements.
 java.lang.String getLineSeparator()
          The character sequence that indicates the end of a line.
protected  void indent(int stops)
           
 void setIndentation(int indentation)
           
 void setLineSeparator(java.lang.String lineSeparator)
           
protected  void startElement(XMLName name)
           
protected  void writeMargin()
           
 void xmlHeader(java.lang.String encoding)
          Write <?xml version="1.0" sax...
 
Methods inherited from class com.openharbor.beck.write.FastXMLWriter
attribute, beginContent, choosePrefix, close, declareNamespace, flush, write, write, write, write
 
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
 

Constructor Detail

DefaultXMLWriter

public DefaultXMLWriter(java.io.Writer out)
Method Detail

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 name
publicId - 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