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
-
Constructor Summary
ConstructorDescriptionSaxEventHandler
(SortableDefaultMutableTreeNode startNode, LabelFrame loadProgressGui, StringBuilder lowresUrls) Constructs the Sax XML parser -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] buf, int offset, int len) method invoked by the parser when characters are read between tags.void
endElement
(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 InputSource
Returns the collection.dtd definition as an InputSource.resolveEntity
(String publicId, String systemId) try to resolve where the file belongsvoid
startElement
(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, 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
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:
startElement
in interfaceContentHandler
- Overrides:
startElement
in 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:
endElement
in interfaceContentHandler
- Overrides:
endElement
in 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:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Parameters:
buf
- The bufferoffset
- Start offsetlen
- Length
-
resolveEntity
try to resolve where the file belongs- Specified by:
resolveEntity
in interfaceEntityResolver
- Overrides:
resolveEntity
in 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
-