public class DefaultElementContext extends java.lang.Object implements ElementContext, ElementStartContext, ElementEndContext
Constructor and Description |
---|
DefaultElementContext() |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator |
getAttributeNames()
Iterates over the collection of attribute names for the element in
context.
|
java.lang.String |
getAttributeValue(java.lang.String attributeName)
Get the value of an attribute for this element.
|
java.lang.String |
getLocalName()
Get the local name of the current element.
|
XMLLocator |
getLocator()
Get the locator for the EDD being parsed.
|
MessageReporter |
getMessageReporter()
Get the message reporter.
|
java.lang.String |
getNamespaceURI()
Get the namespace URI of the current element.
|
java.lang.String |
getParentLocalName()
Get the local name of the parent element, if any.
|
java.lang.String |
getPath()
Get the path to the current element.
|
ElementHandler |
getScopedHandler()
Get a scoped handler for the current element (if any)
|
java.lang.String |
getText()
Get the text contained in this element.
|
java.lang.Object |
getValue(Key key)
Get a value stored in this context.
|
void |
putValue(Key key,
java.lang.Object value)
Store a value in this context.
|
void |
registerChildHandler(java.lang.String namespaceURI,
java.lang.String localName,
ElementHandler handler)
Register a handler that will be used only for immediate children of the
current element.
|
void |
registerScopeHandler(java.lang.String localElementName,
ElementHandler handler)
Register a handler that will bs used within the scope of the current
element and all its descendants.
|
void |
registerScopeHandler(java.lang.String namespaceURI,
java.lang.String localElementName,
ElementHandler handler)
Register a handler that will bs used within the scope of the current
element and all its descendants.
|
void |
registerScopeHandlerFactory(ElementHandlerFactory factory)
Register a factory that can dynamically retrieve element handlers
for XML elements in the current scope.
|
void |
removeValue(Key key)
Clear a value from this context.
|
void |
setMessageReporter(MessageReporter reporter) |
public java.lang.String getLocalName()
getLocalName
in interface ElementContext
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface ElementContext
public java.lang.String getPath()
public java.lang.String getParentLocalName()
getParentLocalName
in interface ElementContext
public java.lang.String getText()
getText
in interface ElementEndContext
public java.lang.String getAttributeValue(java.lang.String attributeName)
getAttributeValue
in interface ElementStartContext
attributeName
- the local name of an XML attribute, must not be
null.public java.util.Iterator getAttributeNames()
getAttributeNames
in interface ElementStartContext
public java.lang.Object getValue(Key key)
getValue
in interface ElementContext
key
- a key for the stored valuepublic void putValue(Key key, java.lang.Object value)
putValue
in interface ElementContext
key
- a key for the value.value
- the value to store, can be null.public void removeValue(Key key)
removeValue
in interface ElementContext
public void registerChildHandler(java.lang.String namespaceURI, java.lang.String localName, ElementHandler handler)
registerChildHandler
in interface ElementContext
namespaceURI
- localName
- handler
- public void registerScopeHandler(java.lang.String localElementName, ElementHandler handler)
ElementContext
registerScopeHandler
in interface ElementContext
localElementName
- the name of the element to handlehandler
- the handler to usepublic void registerScopeHandler(java.lang.String namespaceURI, java.lang.String localElementName, ElementHandler handler)
ElementContext
registerScopeHandler
in interface ElementContext
namespaceURI
- the namespace URI of the element to handlelocalElementName
- the name of the element to handlehandler
- the handler to usepublic void registerScopeHandlerFactory(ElementHandlerFactory factory)
ElementContext
registerScopeHandlerFactory
in interface ElementContext
factory
- the factory to registerpublic ElementHandler getScopedHandler()
public XMLLocator getLocator()
getLocator
in interface ElementContext
public MessageReporter getMessageReporter()
ElementContext
getMessageReporter
in interface ElementContext
public void setMessageReporter(MessageReporter reporter)
setMessageReporter
in interface ElementContext