com.tekann.webservice.client.parser
Class AnswerParser

java.lang.Object
  extended by totalcross.xml.XmlTokenizer
      extended by com.tekann.webservice.client.parser.AnswerParser
Direct Known Subclasses:
Base64AnswerParser, DBMessageParser, DTDXMLParser, DTOParser, PDAContextParser, SyncQueryParser, SyncTablesParser, TableRangesParser

public abstract class AnswerParser
extends totalcross.xml.XmlTokenizer

This class can be used to implement a parser

Author:
evandro

Field Summary
protected  java.lang.String lastAttributeName
          The last read attribute name
protected  java.lang.String lastAttributeValue
          The last read attribute value
protected  totalcross.io.ByteArrayStream lastData
          The last read data
protected  java.lang.String lastEndTag
          The last read end tag.
protected  java.lang.String lastStartTag
          The last read start tag
protected  totalcross.io.Stream stream
          The stream itself.
 
Constructor Summary
AnswerParser(totalcross.io.Stream stream)
          Creates a new instance of AnswerParser
 
Method Summary
 void foundAttributeName(byte[] buffer, int offset, int count)
           
 void foundAttributeValue(byte[] buffer, int offset, int count, byte dlm)
           
 void foundCharacter(char charFound)
           
 void foundCharacterData(byte[] buffer, int offset, int count)
           
 void foundEndEmptyTag()
           
 void foundEndTagName(byte[] buffer, int offset, int count)
           
 void foundStartTagName(byte[] buffer, int offset, int count)
           
protected  void init()
          Initialize the parser
protected  boolean isReturn(java.lang.String tag)
          Tests if it is a return tag
abstract  java.lang.Object storeAnswer()
          Store the answer somehow
 
Methods inherited from class totalcross.xml.XmlTokenizer
disableReferenceResolution, foundComment, foundDeclaration, foundEndOfInput, foundInvalidData, foundProcessingInstruction, foundReference, foundStartOfInput, 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
 

Field Detail

lastAttributeName

protected java.lang.String lastAttributeName
The last read attribute name


lastAttributeValue

protected java.lang.String lastAttributeValue
The last read attribute value


lastData

protected totalcross.io.ByteArrayStream lastData
The last read data


lastEndTag

protected java.lang.String lastEndTag
The last read end tag.


lastStartTag

protected java.lang.String lastStartTag
The last read start tag


stream

protected totalcross.io.Stream stream
The stream itself.

Constructor Detail

AnswerParser

public AnswerParser(totalcross.io.Stream stream)
Creates a new instance of AnswerParser

Parameters:
stream -
Method Detail

foundAttributeName

public void foundAttributeName(byte[] buffer,
                               int offset,
                               int count)
Overrides:
foundAttributeName in class totalcross.xml.XmlTokenizer

foundAttributeValue

public void foundAttributeValue(byte[] buffer,
                                int offset,
                                int count,
                                byte dlm)
Overrides:
foundAttributeValue in class totalcross.xml.XmlTokenizer

foundCharacter

public void foundCharacter(char charFound)
Overrides:
foundCharacter in class totalcross.xml.XmlTokenizer

foundCharacterData

public void foundCharacterData(byte[] buffer,
                               int offset,
                               int count)
Overrides:
foundCharacterData in class totalcross.xml.XmlTokenizer

foundEndEmptyTag

public void foundEndEmptyTag()
Overrides:
foundEndEmptyTag in class totalcross.xml.XmlTokenizer

foundEndTagName

public void foundEndTagName(byte[] buffer,
                            int offset,
                            int count)
Overrides:
foundEndTagName in class totalcross.xml.XmlTokenizer

foundStartTagName

public void foundStartTagName(byte[] buffer,
                              int offset,
                              int count)
Overrides:
foundStartTagName in class totalcross.xml.XmlTokenizer

init

protected void init()
             throws totalcross.xml.SyntaxException,
                    totalcross.io.IOException
Initialize the parser

Throws:
totalcross.xml.SyntaxException
totalcross.io.IOException

isReturn

protected boolean isReturn(java.lang.String tag)
Tests if it is a return tag

Parameters:
tag -
Returns:

storeAnswer

public abstract java.lang.Object storeAnswer()
Store the answer somehow

Returns: