java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.jpo.datamodel.SaxEventHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
A xml parser to load the collections.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSaxEventHandler(SortableDefaultMutableTreeNode startNode, LabelFrame loadProgressGui, StringBuilder lowresUrls) Constructs the Sax XML parser -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] buf, int offset, int len) method invoked by the parser when characters are read between tags.voidendElement(String namespaceURI, String sName, String qName) method that gets invoked by the parser when an end element is discovered; used here to go back to the parent group if a <group> tag is found.static InputSourceReturns the collection.dtd definition as an InputSource.resolveEntity(String publicId, String systemId) try to resolve where the file belongsvoidstartElement(String namespaceURI, String lName, String qName, Attributes attrs) method that gets invoked by the parser when a new element is discoveredMethods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
INDEX
constant- See Also:
-
-
Constructor Details
-
SaxEventHandler
public SaxEventHandler(SortableDefaultMutableTreeNode startNode, LabelFrame loadProgressGui, StringBuilder lowresUrls) Constructs the Sax XML parser- Parameters:
startNode- The starting nodeloadProgressGui- the progress GUI to updatelowresUrls- the lowresUrls to pick up on
-
-
Method Details
-
startElement
method that gets invoked by the parser when a new element is discovered- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Parameters:
namespaceURI- NamespacelName- local nameqName- qualified nameattrs- attributes
-
endElement
method that gets invoked by the parser when an end element is discovered; used here to go back to the parent group if a <group> tag is found.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
namespaceURI- the URIsName- the simple nameqName- the qualified name
-
characters
public void characters(char[] buf, int offset, int len) method invoked by the parser when characters are read between tags. The variable interpretChars is set so that the characters can be put in the right place- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Parameters:
buf- The bufferoffset- Start offsetlen- Length
-
resolveEntity
try to resolve where the file belongs- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler- Parameters:
publicId- public idsystemId- system id- Returns:
- the dtd as an input source
- Throws:
IOException
-
getCollectionDtdInputSource
Returns the collection.dtd definition as an InputSource.- Returns:
- The collection. dtd file
- Throws:
IOException- If something went wrong
-