Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.byteml.serialize
Class ByteMLBeautyHandler  view ByteMLBeautyHandler download ByteMLBeautyHandler.java

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.byteml.serialize.ByteMLBeautyHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ByteMLBeautyHandler
extends org.xml.sax.helpers.DefaultHandler

Custom SAX Handler to format the XML file better. Linited scope only.


Field Summary
private  int depth
          Depth of doc
private  java.lang.String ln
          Line Separator for the platform
private  java.lang.StringBuffer sb
          StringBuffer
 
Constructor Summary
ByteMLBeautyHandler()
          No-arg constructor
 
Method Summary
private  void appendNewLine()
          Appends a new line to the stringbuffer.
 void characters(char[] ch, int start, int length)
          Receive notification of character data inside an element.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Receive notification of the end of an element.
 java.lang.String getXml()
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
          Receive notification of the start of an element.
private  java.lang.String writeChar(char ch)
          XML Equivaluent of a character.
private  void writeString(java.lang.String str)
          Writes a String
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sb

private java.lang.StringBuffer sb
StringBuffer


ln

private java.lang.String ln
Line Separator for the platform


depth

private int depth
Depth of doc

Constructor Detail

ByteMLBeautyHandler

public ByteMLBeautyHandler()
No-arg constructor

Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).


endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).


characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).


getXml

public java.lang.String getXml()

appendNewLine

private void appendNewLine()
Appends a new line to the stringbuffer.


writeString

private void writeString(java.lang.String str)
Writes a String


writeChar

private java.lang.String writeChar(char ch)
XML Equivaluent of a character.