superwaba.ext.xplat.xml
Class DumpXml

java.lang.Object
  |
  +--superwaba.ext.xplat.xml.XmlTokenizer
        |
        +--superwaba.ext.xplat.xml.DumpXml

public class DumpXml
extends XmlTokenizer

Dumb Xml class used only to dump to the Debug Console the contents of a XML. It implementss each of the methods that are called by the XmlTokenizer class. You can run this to understand how to handle a XML.


Constructor Summary
DumpXml()
          Must call tokenize by yourself.
DumpXml(Stream stream)
           
 
Method Summary
 void foundAttributeName(byte[] buffer, int offset, int count)
          Method called when an attribute name has been found.
 void foundAttributeValue(byte[] buffer, int offset, int count, byte dlm)
          Method called when an attribute value has been found.
 void foundCharacter(char charFound)
          Method called when a character has been found in contents, this character resulting from a character reference resolution.
 void foundCharacterData(byte[] buffer, int offset, int count)
          Method called when character data content has been found.
 void foundEndEmptyTag()
          Method called when an empty-tag has been found.
 void foundEndOfInput(int count)
          Method called when the end of the input was found, and tokenization is about to end.
 void foundEndTagName(byte[] buffer, int offset, int count)
          Method called when an end-tag has been found.
 void foundStartOfInput(byte[] buffer, int offset, int count)
          Method called before to start tokenizing.
 void foundStartTagName(byte[] buffer, int offset, int count)
          Method called when a start-tag has been found.
 
Methods inherited from class superwaba.ext.xplat.xml.XmlTokenizer
disableReferenceResolution, foundComment, foundDeclaration, foundInvalidData, foundProcessingInstruction, foundReference, getAbsoluteOffset, isDataCDATA, resolveCharacterReference, setCdataContents, setStrictlyXml, tokenize, tokenize, tokenize, tokenize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DumpXml

public DumpXml()
Must call tokenize by yourself.

DumpXml

public DumpXml(Stream stream)
        throws SyntaxException
Method Detail

foundStartOfInput

public void foundStartOfInput(byte[] buffer,
                              int offset,
                              int count)
Description copied from class: XmlTokenizer
Method called before to start tokenizing.

Derived class may override this method, for doing whatever appropriate housekeeping (sniffing at the encoding, etc.)

Overrides:
foundStartOfInput in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
input - byte array containing the first bytes of the input about to be tokenized
offset - position of the first byte to be tokenized
count - number of bytes to be tokenized

foundStartTagName

public void foundStartTagName(byte[] buffer,
                              int offset,
                              int count)
Description copied from class: XmlTokenizer
Method called when a start-tag has been found.

Derived class may override this method.

Overrides:
foundStartTagName in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
input - byte array containing the name of the tag that started
offset - position of the first character of the tag name in the array
count - number of bytes the tag name is made of

foundEndTagName

public void foundEndTagName(byte[] buffer,
                            int offset,
                            int count)
Description copied from class: XmlTokenizer
Method called when an end-tag has been found.

Derived class may override this method.

Overrides:
foundEndTagName in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
input - byte array containing the name of the tag that ended
offset - position of the first character of the tag name in the array
count - number of bytes the tag name is made of

foundEndEmptyTag

public void foundEndEmptyTag()
Description copied from class: XmlTokenizer
Method called when an empty-tag has been found.

This method is called just after all events related to the starting tag have been reported. The implied tagName is the one of the starting tag (e.g.: the most recently reported start-tag.)

Derived class may override this method.

 Example:
    generates:
   - foundStartTagName("FOO");
   - foundAttributeName("A");
   - foundAttributeValue("B");
   - foundEndEmptyTag();
 
Overrides:
foundEndEmptyTag in class XmlTokenizer

foundCharacterData

public void foundCharacterData(byte[] buffer,
                               int offset,
                               int count)
Description copied from class: XmlTokenizer
Method called when character data content has been found.

Derived class may override this method.

Overrides:
foundCharacterData in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
input - byte array containing the character data that was found
offset - position of the first character data in the array
count - number of bytes the character data content is made of

foundCharacter

public void foundCharacter(char charFound)
Description copied from class: XmlTokenizer
Method called when a character has been found in contents, this character resulting from a character reference resolution.

Derived class may override this method.

Overrides:
foundCharacter in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
charFound - resolved character - if the character is invalid, this value is set to '\uffff', which is not a Unicode character.
See Also:
XmlTokenizer.foundReference(byte[],int,int)

foundAttributeName

public void foundAttributeName(byte[] buffer,
                               int offset,
                               int count)
Description copied from class: XmlTokenizer
Method called when an attribute name has been found.

Derived class may override this method.

Overrides:
foundAttributeName in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
input - byte array containing the attribute name
offset - position of the first character of the attribute name in the array
count - number of bytes the attribute name is made of

foundAttributeValue

public void foundAttributeValue(byte[] buffer,
                                int offset,
                                int count,
                                byte dlm)
Description copied from class: XmlTokenizer
Method called when an attribute value has been found.

Derived class may override this method.

Overrides:
foundAttributeValue in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
input - byte array containing the attribute value
offset - position of the first character of the attribute value in the array
count - number of bytes the attribute value is made of
dlm - delimiter that started the attribute value (' or "). '\0' if none

foundEndOfInput

public void foundEndOfInput(int count)
Description copied from class: XmlTokenizer
Method called when the end of the input was found, and tokenization is about to end.

Derived class may override this method.

Overrides:
foundEndOfInput in class XmlTokenizer
Tags copied from class: XmlTokenizer
Parameters:
count - count of bytes parsed