casxml
Class CASHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by xml.BasicSAXHandler
          extended by casxml.CASHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class CASHandler
extends xml.BasicSAXHandler

SAX handler for CAS 2.1 data, providing the class method readCASSigns(java.lang.String) to obtain CAS animation data from a given URL.


Field Summary
static java.lang.String AVATAR_TAG
           
static java.lang.String BLANK
           
static java.lang.String BONE_TAG
           
static java.lang.String BONECOUNT_TAG
           
static java.lang.String CAS_TAG
           
static java.lang.String COUNT_TAG
           
static java.lang.String DURATION_TAG
           
static java.lang.String FRAME_TAG
           
static java.lang.String FRAMES_TAG
           
static java.lang.String GLOSS_TAG
           
static java.lang.String INDEX_TAG
           
static java.lang.String ISCOMPLETE_TAG
           
static java.lang.String MORPH_TAG
           
static java.lang.String MORPHCOUNT_TAG
           
static java.lang.String NAME_TAG
           
static java.lang.String POSITION_TAG
           
static java.lang.String QROTATION_TAG
           
static java.lang.String SIGNCOUNT_TAG
           
static java.lang.String SIGNSTART_TAG
           
static java.lang.String TIME_TAG
           
static java.lang.String VALUE_TAG
           
static java.lang.String VERSION_TAG
           
static java.lang.String W_TAG
           
static java.lang.String X_TAG
           
static java.lang.String Y_TAG
           
static java.lang.String Z_TAG
           
 
Constructor Summary
CASHandler()
          Constructs a new CAS 2.1 SAX input handler.
 
Method Summary
 void endDocument()
          Handler for end-document event.
 void endElement(java.lang.String nsuri, java.lang.String localnm, java.lang.String rawnm)
          Handler for CAS end-document event.
 AnimatedSign[] extractAnimation()
          Returns the sequence of animated signs generated by this handler.
static AnimatedSign[] readCASSigns(org.xml.sax.InputSource cassrc)
          Reads the CAS 2.1 document at the given input source, converting it to an array of AnimatedSigns, and returning this array -- or returning null if a XMLScanner.ScanException occurs.
static AnimatedSign[] readCASSigns(java.io.InputStream casins)
          Reads the CAS 2.1 document on the given input stream, converting it to an array of AnimatedSigns, and returning this array -- or returning null if a XMLScanner.ScanException occurs.
static AnimatedSign[] readCASSigns(java.lang.String casurl)
          Reads the CAS 2.1 document at the given URL, converting it to an array of AnimatedSigns, and returning this array -- or returning null if a XMLScanner.ScanException occurs.
 void startDocument()
          Handler for start-document event.
 void startElement(java.lang.String nsuri, java.lang.String localnm, java.lang.String rawnm, org.xml.sax.Attributes attribs)
          Handler for CAS start-element event.
 
Methods inherited from class xml.BasicSAXHandler
error, fatalError, resolveEntity, setDocumentLocator, warning
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAS_TAG

public static final java.lang.String CAS_TAG

FRAMES_TAG

public static final java.lang.String FRAMES_TAG

FRAME_TAG

public static final java.lang.String FRAME_TAG

MORPH_TAG

public static final java.lang.String MORPH_TAG

BONE_TAG

public static final java.lang.String BONE_TAG

POSITION_TAG

public static final java.lang.String POSITION_TAG

QROTATION_TAG

public static final java.lang.String QROTATION_TAG

AVATAR_TAG

public static final java.lang.String AVATAR_TAG

COUNT_TAG

public static final java.lang.String COUNT_TAG

DURATION_TAG

public static final java.lang.String DURATION_TAG

NAME_TAG

public static final java.lang.String NAME_TAG

VALUE_TAG

public static final java.lang.String VALUE_TAG

BONECOUNT_TAG

public static final java.lang.String BONECOUNT_TAG

MORPHCOUNT_TAG

public static final java.lang.String MORPHCOUNT_TAG

ISCOMPLETE_TAG

public static final java.lang.String ISCOMPLETE_TAG

SIGNCOUNT_TAG

public static final java.lang.String SIGNCOUNT_TAG

SIGNSTART_TAG

public static final java.lang.String SIGNSTART_TAG

GLOSS_TAG

public static final java.lang.String GLOSS_TAG

VERSION_TAG

public static final java.lang.String VERSION_TAG

TIME_TAG

public static final java.lang.String TIME_TAG

INDEX_TAG

public static final java.lang.String INDEX_TAG

X_TAG

public static final java.lang.String X_TAG

Y_TAG

public static final java.lang.String Y_TAG

Z_TAG

public static final java.lang.String Z_TAG

W_TAG

public static final java.lang.String W_TAG

BLANK

public static final java.lang.String BLANK
Constructor Detail

CASHandler

public CASHandler()
Constructs a new CAS 2.1 SAX input handler.

Method Detail

readCASSigns

public static AnimatedSign[] readCASSigns(java.io.InputStream casins)
Reads the CAS 2.1 document on the given input stream, converting it to an array of AnimatedSigns, and returning this array -- or returning null if a XMLScanner.ScanException occurs.


readCASSigns

public static AnimatedSign[] readCASSigns(java.lang.String casurl)
Reads the CAS 2.1 document at the given URL, converting it to an array of AnimatedSigns, and returning this array -- or returning null if a XMLScanner.ScanException occurs.


readCASSigns

public static AnimatedSign[] readCASSigns(org.xml.sax.InputSource cassrc)
Reads the CAS 2.1 document at the given input source, converting it to an array of AnimatedSigns, and returning this array -- or returning null if a XMLScanner.ScanException occurs.


extractAnimation

public AnimatedSign[] extractAnimation()
Returns the sequence of animated signs generated by this handler. This method can only be called once.


startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Handler for start-document event.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Handler for end-document event.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String nsuri,
                         java.lang.String localnm,
                         java.lang.String rawnm,
                         org.xml.sax.Attributes attribs)
                  throws org.xml.sax.SAXException
Handler for CAS start-element event.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String nsuri,
                       java.lang.String localnm,
                       java.lang.String rawnm)
                throws org.xml.sax.SAXException
Handler for CAS end-document event.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException