|
|||||||||
Home >> All >> javax >> ide >> extension >> [ spi overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
javax.ide.extension.spi
Class DefaultElementContext

java.lang.Objectjavax.ide.extension.spi.DefaultElementContext
- All Implemented Interfaces:
- javax.ide.extension.ElementContext, javax.ide.extension.ElementEndContext, javax.ide.extension.ElementStartContext
- public class DefaultElementContext
- extends java.lang.Object
- implements javax.ide.extension.ElementContext, javax.ide.extension.ElementStartContext, javax.ide.extension.ElementEndContext
- extends java.lang.Object
A default XML context implementation. This provides access to methods that change the context and should only be used by ExtensibleSAXHandler.
Nested Class Summary | |
private class |
DefaultElementContext.NullLogger
|
Field Summary | |
private org.xml.sax.Attributes |
_attributes
|
private java.util.Map |
_ceChildHandlers
|
private Stack |
_childHandlers
|
private ScopedMap |
_contextMap
|
private Stack |
_elementPathStack
|
private Stack |
_elementText
|
private java.util.logging.Logger |
_logger
|
private javax.ide.extension.ElementName |
_name
|
private java.util.List |
_visitorFactories
|
Constructor Summary | |
DefaultElementContext()
|
Method Summary | |
(package private) void |
appendCharacters(char[] characters,
int start,
int length)
|
(package private) void |
beginElement(java.lang.String uri,
java.lang.String name,
org.xml.sax.Attributes attributes)
|
(package private) void |
endElement(java.lang.String uri,
java.lang.String name)
|
java.util.Collection |
getAttributeNames()
Get the (local) names of all attributes available on the current element. |
java.lang.String |
getAttributeValue(java.lang.String attributeName)
Get the value of an attribute for this element. |
javax.ide.extension.ElementName |
getElementName()
Get the local name of the current element. |
javax.ide.extension.Extension |
getExtension()
Get the extension currently being processed. |
java.net.URI |
getExtensionSourceURI()
Get the URI of the source of the extension. |
java.util.logging.Logger |
getLogger()
Get the logger to which warning, error and information messages should be sent by the visitor. |
java.util.Map |
getScopeData()
Get scope data for the current context. |
javax.ide.extension.ElementVisitor |
getScopedHandler()
Get a scoped handler for the current element (if any) |
java.lang.String |
getText()
Get the text contained in this element. |
(package private) void |
postBeginElement()
Push the current element onto the element stack. |
(package private) void |
postEndElement()
|
void |
registerChildVisitor(javax.ide.extension.ElementName name,
javax.ide.extension.ElementVisitor visitor)
Register a handler that will be used only for immediate children of the current element. |
void |
registerVisitorFactory(javax.ide.extension.ElementVisitorFactory factory)
Register a factory that can dynamically retrieve visitors for named elements. |
private void |
setElement(java.lang.String uri,
java.lang.String name)
|
void |
setMessageReporter(java.util.logging.Logger logger)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
_attributes
private org.xml.sax.Attributes _attributes
_name
private javax.ide.extension.ElementName _name
_elementPathStack
private final Stack _elementPathStack
_contextMap
private final ScopedMap _contextMap
_elementText
private final Stack _elementText
_childHandlers
private final Stack _childHandlers
_ceChildHandlers
private java.util.Map _ceChildHandlers
_logger
private java.util.logging.Logger _logger
_visitorFactories
private final java.util.List _visitorFactories
Constructor Detail |
DefaultElementContext
public DefaultElementContext()
Method Detail |
getElementName
public javax.ide.extension.ElementName getElementName()
- Get the local name of the current element.
- Specified by:
getElementName
in interfacejavax.ide.extension.ElementContext
getText
public java.lang.String getText()
- Get the text contained in this element. It's only valid to call this from
EDDElementHandler.handleEndElement.
- Specified by:
getText
in interfacejavax.ide.extension.ElementEndContext
getAttributeValue
public java.lang.String getAttributeValue(java.lang.String attributeName)
- Get the value of an attribute for this element. It's only valid to call
this from EDDElementHandler.handleStartElement.
- Specified by:
getAttributeValue
in interfacejavax.ide.extension.ElementStartContext
getAttributeNames
public java.util.Collection getAttributeNames()
- Description copied from interface:
javax.ide.extension.ElementStartContext
- Get the (local) names of all attributes available on the current
element.
- Specified by:
getAttributeNames
in interfacejavax.ide.extension.ElementStartContext
getScopeData
public java.util.Map getScopeData()
- Description copied from interface:
javax.ide.extension.ElementContext
- Get scope data for the current context. The returned map is
scoped: values put 55
into the map can only be retrieved by the current visitor or visitors
of descendent elements of the current element.
- Specified by:
getScopeData
in interfacejavax.ide.extension.ElementContext
registerChildVisitor
public void registerChildVisitor(javax.ide.extension.ElementName name, javax.ide.extension.ElementVisitor visitor)
- Register a handler that will be used only for immediate children of the
current element.
- Specified by:
registerChildVisitor
in interfacejavax.ide.extension.ElementContext
registerVisitorFactory
public void registerVisitorFactory(javax.ide.extension.ElementVisitorFactory factory)
- Description copied from interface:
javax.ide.extension.ElementContext
- Register a factory that can dynamically retrieve visitors for named
elements.
- Specified by:
registerVisitorFactory
in interfacejavax.ide.extension.ElementContext
getScopedHandler
public javax.ide.extension.ElementVisitor getScopedHandler()
- Get a scoped handler for the current element (if any)
setElement
private void setElement(java.lang.String uri, java.lang.String name)
beginElement
void beginElement(java.lang.String uri, java.lang.String name, org.xml.sax.Attributes attributes)
appendCharacters
void appendCharacters(char[] characters, int start, int length)
postEndElement
void postEndElement()
endElement
void endElement(java.lang.String uri, java.lang.String name)
postBeginElement
void postBeginElement()
- Push the current element onto the element stack.
getLogger
public java.util.logging.Logger getLogger()
- Description copied from interface:
javax.ide.extension.ElementContext
- Get the logger to which warning, error and information messages should be
sent by the visitor.
- Specified by:
getLogger
in interfacejavax.ide.extension.ElementContext
setMessageReporter
public void setMessageReporter(java.util.logging.Logger logger)
getExtension
public javax.ide.extension.Extension getExtension()
- Get the extension currently being processed.
- Specified by:
getExtension
in interfacejavax.ide.extension.ElementContext
getExtensionSourceURI
public java.net.URI getExtensionSourceURI()
- Get the URI of the source of the extension. For extensions packaged in
JAR files, this is the URI of the JAR file.
- Specified by:
getExtensionSourceURI
in interfacejavax.ide.extension.ElementContext
|
|||||||||
Home >> All >> javax >> ide >> extension >> [ spi overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |