Class SaxVinciFrameBuilder
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.uima.adapter.vinci.util.SaxVinciFrameBuilder
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Direct Known Subclasses:
UimaSaxVinciFrameBuilder
public class SaxVinciFrameBuilder extends DefaultHandler implements ContentHandler
A SAX content handler that builds a VinciFrame corresponding to the SAX events received.
-
-
Constructor Summary
Constructors Constructor Description SaxVinciFrameBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidendElement(String namespaceURI, String localName, String qualifiedName)protected StringgetLeafContent(String aFrameName, Attributes aAttributes, StringBuffer aContentBuf)Gets the content to be included in a FrameLeaf.protected StringgetName(String s1, String s2)If the first String parameter is nonempty, return it, else return the second string parameter.voidsetParentFrame(AFrame aParentFrame)Sets the parent frame, to which frames built by the object will be added.voidstartDocument()voidstartElement(String namespaceURI, String localName, String qualifiedName, Attributes attributes)Called for each start tag encountered.-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xml.sax.ContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping
-
-
-
-
Method Detail
-
setParentFrame
public void setParentFrame(AFrame aParentFrame)
Sets the parent frame, to which frames built by the object will be added. This MUST be called before parsing a document.- Parameters:
aParentFrame- the parent frame
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException- See Also:
ContentHandler.startDocument()
-
startElement
public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes attributes) throws SAXException
Called for each start tag encountered.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Parameters:
namespaceURI- Required if the namespaces property is true.attributes- The specified or defaulted attributes.localName- The local name (without prefix), or the empty string if Namespace processing is not being performed.qualifiedName- The qualified name (with prefix), or the empty string if qualified names are not available.- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length)- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- See Also:
ContentHandler.characters(char[],int,int)
-
endElement
public void endElement(String namespaceURI, String localName, String qualifiedName)
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- See Also:
ContentHandler.endElement(String,String,String)
-
getLeafContent
protected String getLeafContent(String aFrameName, Attributes aAttributes, StringBuffer aContentBuf)
Gets the content to be included in a FrameLeaf. This method just returns the contents of the provided StringBuffer, but subclasses can override to provide specialized content.- Parameters:
aFrameName- name of the FrameLeafaAttributes- attributes of FrameLeafaContentBuf- StringBuffer containing the character data obtained from the SAX parser- Returns:
- the data to be included in the Vinci FrameLeaf
-
-