| java.lang.Object org.griphyn.vdl.parser.VDLContentHandler
VDLContentHandler | public class VDLContentHandler implements ContentHandler(Code) | | This class establishes the in-memory construction of Definition
objects read, and does the callback on the storage interface.
This class is the content handler for the XML document being parsed.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: Definition See Also: DefinitionHandler See Also: |
Method Summary | |
public void | characters(char[] ch, int start, int length) This method is the callback function for characters in an element. | protected VDL | createObject(String e, java.util.List names, java.util.List values) This method determines the actively parsed element, creates the
Java object that corresponds to the element, and sets the member
variables with the values of the attributes of the element.
Parameters: e - is the name of the element Parameters: names - is a list of attribute names, as strings. Parameters: values - is a list of attribute values, to match the key list. | public void | endDocument() This method specifies what to do when the parser reached the end
of the document. | public void | endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) The parser is at the end of an element. | public void | endPrefixMapping(java.lang.String prefix) Out of the reach of the prefix, remove it from the HashMap. | public void | ignorableWhitespace(char[] ch, int start, int length) Currently, ignorable whitespace will be ignored. | public void | processingInstruction(java.lang.String target, java.lang.String data) Receive a processing instruction. | public void | setDefinitionHandler(DefinitionHandler ds) Accessor: This function allows a different DefinitionHandler to
be set and used. | public void | setDocumentLocator(Locator locator) Obtains the document locator from the parser. | protected boolean | setElementRelation(char initial, VDL parent, VDL child) This method sets the relations between the currently finished XML
element and its containing element in terms of Java objects. | public void | setFinalizerHandler(FinalizerHandler fh) Accessor: This function allows a different FinalizerHandler to
be set and used. | public void | skippedEntity(java.lang.String name) Receive a notification that an entity was skipped. | public void | startDocument() This method specifies what to do when the parser is at the beginning
of the document. | public void | startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) This method defines the action to take when the parser begins to parse
an element. | public void | startPrefixMapping(java.lang.String prefix, java.lang.String uri) There is a prefix or namespace defined, put the prefix and its URI
in the HashMap. |
VDLContentHandler | public VDLContentHandler()(Code) | | ctor.
|
characters | public void characters(char[] ch, int start, int length) throws SAXException(Code) | | This method is the callback function for characters in an element.
The element is expected to be of mixed content.
Parameters: ch - are the characters from the XML document Parameters: start - is the start position into the array Parameters: length - is the amount of valid data in the array |
createObject | protected VDL createObject(String e, java.util.List names, java.util.List values) throws IllegalArgumentException(Code) | | This method determines the actively parsed element, creates the
Java object that corresponds to the element, and sets the member
variables with the values of the attributes of the element.
Parameters: e - is the name of the element Parameters: names - is a list of attribute names, as strings. Parameters: values - is a list of attribute values, to match the key list. A new VDL Java object, which may only be partly constructed. exception: IllegalArgumentException - if the element name is too short. |
endDocument | public void endDocument() throws SAXException(Code) | | This method specifies what to do when the parser reached the end
of the document. In this case, we simply print a message for debugging.
|
endElement | public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws SAXException(Code) | | The parser is at the end of an element. Each successfully and
completely parsed Definition will trigger a callback to the
registered DefinitionHandler.
Parameters: namespaceURI - is the URI of the namespace for the element Parameters: localName - is the element name without namespace Parameters: qName - is the element name as it appears in the docment |
endPrefixMapping | public void endPrefixMapping(java.lang.String prefix) throws SAXException(Code) | | Out of the reach of the prefix, remove it from the HashMap.
Parameters: prefix - is the prefix that was being mapped previously. |
ignorableWhitespace | public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException(Code) | | Currently, ignorable whitespace will be ignored.
Parameters: ch - are the characters from the XML document Parameters: start - is the start position into the array Parameters: length - is the amount of valid data in the array |
processingInstruction | public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException(Code) | | Receive a processing instruction. Currently, we are just printing
a debug message that we received a PI.
Parameters: target - the processing instruction target Parameters: data - the processing instruction data, or null if none was supplied.The data does not include any whitespace separating it from the target. |
setDefinitionHandler | public void setDefinitionHandler(DefinitionHandler ds)(Code) | | Accessor: This function allows a different DefinitionHandler to
be set and used.
Parameters: ds - is the new callback object to handle each Definitionas it becomes ready. |
setDocumentLocator | public void setDocumentLocator(Locator locator)(Code) | | Obtains the document locator from the parser. The document location
can be used to print debug information, i.e the current location
(line, column) in the document.
Parameters: locator - is the externally set current position |
setElementRelation | protected boolean setElementRelation(char initial, VDL parent, VDL child)(Code) | | This method sets the relations between the currently finished XML
element and its containing element in terms of Java objects.
Usually it involves adding the object to the parent's child object
list.
Parameters: initial - is the first charactor of the parent element name Parameters: parent - is a reference to the parent's Java object Parameters: child - is the completed child object to connect to the parent true if the element was added successfully, false, if thechild does not match into the parent. |
setFinalizerHandler | public void setFinalizerHandler(FinalizerHandler fh)(Code) | | Accessor: This function allows a different FinalizerHandler to
be set and used. Note, this cannot be used for the Definitions
elements. In order to reduce the memory footprint, the Definitions
element will not be maintained!
Parameters: fh - is the new callback object to handle a single top-levelVDL element as it becomes ready. |
skippedEntity | public void skippedEntity(java.lang.String name) throws SAXException(Code) | | Receive a notification that an entity was skipped. Currently, we
are just printing a debug message to this fact.
Parameters: name - The name of the skipped entity. If it is a parameterentity, the name will begin with '%', and if it is the external DTDsubset, it will be the string "[dtd]". |
startDocument | public void startDocument() throws SAXException(Code) | | This method specifies what to do when the parser is at the beginning
of the document. In this case, we simply print a message for debugging.
|
startElement | public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) throws SAXException(Code) | | This method defines the action to take when the parser begins to parse
an element.
Parameters: namespaceURI - is the URI of the namespace for the element Parameters: localName - is the element name without namespace Parameters: qName - is the element name as it appears in the docment Parameters: atts - has the names and values of all the attributes |
startPrefixMapping | public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws SAXException(Code) | | There is a prefix or namespace defined, put the prefix and its URI
in the HashMap. We can get the URI when the prefix is used here after.
Parameters: prefix - the Namespace prefix being declared. Parameters: uri - the Namespace URI the prefix is mapped to. |
|
|