Class XMLParsingContext
- java.lang.Object
-
- org.apache.manifoldcf.connectorcommon.fuzzyml.XMLParsingContext
-
- Direct Known Subclasses:
XMLStringParsingContext,XMLWriterParsingContext
public class XMLParsingContext extends java.lang.ObjectAn instance of this class represents a parsing context within a node. Parsing functionality is implemented by extending this class to do the right thing for the context in which it is deployed. The base functionality "does nothing"; extended functionality is needed to interpret nodes and act upon them.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringlocalnameThe localname associated with the contextprotected java.lang.StringnamespaceThe namespace associated with the contextprotected XMLParsingContextpreviousContextThe previous contextprotected java.lang.StringqnameThe qname associated with the contextprotected java.util.Map<java.lang.String,java.lang.String>theseAttributesThe attributes belonging to the node associated with this contextprotected XMLFuzzyHierarchicalParseStatetheStreamThe stream we belong to
-
Constructor Summary
Constructors Constructor Description XMLParsingContext(XMLFuzzyHierarchicalParseState theStream)Root constructor.XMLParsingContext(XMLFuzzyHierarchicalParseState theStream, java.lang.String namespace, java.lang.String localname, java.lang.String qname, java.util.Map<java.lang.String,java.lang.String> theseAttributes)Full constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected XMLParsingContextbeginTag(java.lang.String namespace, java.lang.String localName, java.lang.String qName, java.util.Map<java.lang.String,java.lang.String> atts)This method is meant to be extended by classes that extend this class.voidcharacters(java.lang.String contents)Handle content of a tagvoidcleanup()Cleanup this context object, and then recurse up the chain.voidendElement(java.lang.String namespace, java.lang.String localName, java.lang.String qName)Handle the end of a tagprotected voidendTag()This method is meant to be extended by classes that extend this classjava.lang.StringgetAttribute(java.lang.String attributeName)Get an attribute's value, if anyjava.lang.StringgetLocalname()Get the localname of this nodejava.lang.StringgetNamespace()Get the namespace name of this nodejava.lang.StringgetQname()Get the qname of this nodevoidstartElement(java.lang.String namespace, java.lang.String localName, java.lang.String qName, java.util.Map<java.lang.String,java.lang.String> atts)Handle the start of a tagprotected voidtagCleanup()Override this method to be called during cleanupprotected voidtagContents(java.lang.String contents)This method is meant to be extended by classes that extend this class
-
-
-
Field Detail
-
theStream
protected final XMLFuzzyHierarchicalParseState theStream
The stream we belong to
-
previousContext
protected final XMLParsingContext previousContext
The previous context
-
theseAttributes
protected final java.util.Map<java.lang.String,java.lang.String> theseAttributes
The attributes belonging to the node associated with this context
-
namespace
protected final java.lang.String namespace
The namespace associated with the context
-
localname
protected final java.lang.String localname
The localname associated with the context
-
qname
protected final java.lang.String qname
The qname associated with the context
-
-
Constructor Detail
-
XMLParsingContext
public XMLParsingContext(XMLFuzzyHierarchicalParseState theStream)
Root constructor. Used for outer document level.
-
XMLParsingContext
public XMLParsingContext(XMLFuzzyHierarchicalParseState theStream, java.lang.String namespace, java.lang.String localname, java.lang.String qname, java.util.Map<java.lang.String,java.lang.String> theseAttributes)
Full constructor. Used for individual tags.
-
-
Method Detail
-
getAttribute
public java.lang.String getAttribute(java.lang.String attributeName)
Get an attribute's value, if any
-
getNamespace
public java.lang.String getNamespace()
Get the namespace name of this node
-
getLocalname
public java.lang.String getLocalname()
Get the localname of this node
-
getQname
public java.lang.String getQname()
Get the qname of this node
-
startElement
public final void startElement(java.lang.String namespace, java.lang.String localName, java.lang.String qName, java.util.Map<java.lang.String,java.lang.String> atts) throws ManifoldCFExceptionHandle the start of a tag- Throws:
ManifoldCFException
-
endElement
public final void endElement(java.lang.String namespace, java.lang.String localName, java.lang.String qName) throws ManifoldCFExceptionHandle the end of a tag- Throws:
ManifoldCFException
-
characters
public final void characters(java.lang.String contents) throws ManifoldCFExceptionHandle content of a tag- Throws:
ManifoldCFException
-
cleanup
public final void cleanup() throws ManifoldCFExceptionCleanup this context object, and then recurse up the chain. This method is called without fail at the end of any parse, whether it errored out or not, so that proper cleanup always happens for any tags left on the stack.- Throws:
ManifoldCFException
-
beginTag
protected XMLParsingContext beginTag(java.lang.String namespace, java.lang.String localName, java.lang.String qName, java.util.Map<java.lang.String,java.lang.String> atts) throws ManifoldCFException
This method is meant to be extended by classes that extend this class. The form of this method is meant to enable creation of a context object derived from XMLContext that understands how to actually handle tags and content within the current context.- Throws:
ManifoldCFException
-
endTag
protected void endTag() throws ManifoldCFExceptionThis method is meant to be extended by classes that extend this class- Throws:
ManifoldCFException
-
tagContents
protected void tagContents(java.lang.String contents) throws ManifoldCFExceptionThis method is meant to be extended by classes that extend this class- Throws:
ManifoldCFException
-
tagCleanup
protected void tagCleanup() throws ManifoldCFExceptionOverride this method to be called during cleanup- Throws:
ManifoldCFException
-
-