com.objsys.asn1j.runtime
Class Asn1XmlSaxSimpleType

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.objsys.asn1j.runtime.Asn1XerSaxHandler
          extended by com.objsys.asn1j.runtime.Asn1XmlSaxSimpleType
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class Asn1XmlSaxSimpleType
extends Asn1XerSaxHandler

SAX Handler for simple types. This handler captures all text for the first element for which startElement is invoked. Once the all text is captured and the corresponding endElement is invoked, there are two possibilities: 1) if you passed an Asn1Type for element to the constructor, this handler will invoke element.decodeXML to decode the XML text into that object. 2) if you passed null for the constructor's element argument, then you may use getText() to get the XML element's text.


Field Summary
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1XerSaxHandler
mConsumedStartElement, mCurrElemID, mCurrState, mLevel, mStartLevel, mXMLElemName, XERDATA, XEREND, XERINIT, XERSTART, XERUNKNOWN
 
Constructor Summary
Asn1XmlSaxSimpleType(Asn1Type element)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
           
 java.lang.String getText()
          After endElement has been triggered, this may be used to obtain the XML element's text.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1XerSaxHandler
consumeStartElement, endGroup, error, fatalError, getState, init, isComplete, isDecodingAsGroup, matchXMLElemName, setComplete, setLevel, setXMLElemName, warning
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asn1XmlSaxSimpleType

public Asn1XmlSaxSimpleType(Asn1Type element)
Method Detail

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

getText

public java.lang.String getText()
After endElement has been triggered, this may be used to obtain the XML element's text.