Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.javatools.xml.esax
Interface ElementContext

All Known Subinterfaces:
ElementEndContext, ElementStartContext
All Known Implementing Classes:
DefaultElementContext

public interface ElementContext

The context is used to store state information used while parsing an XML source. This interface defines the access ElementHandlers have to the context during all handle methods.

See Also:
ElementStartContext, ElementEndContext

Method Summary
 java.lang.String getLocalName()
          Get the local name of the current element.
 XMLLocator getLocator()
          Get the locator for the XML file 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.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)
           

 

Method Detail

registerChildHandler

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.
Parameters:
namespaceURI -
localName -
handler -

registerScopeHandler

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. You should normally call this from ElementHandler.beginElement(). Handlers registered this way are static. To register a factory that dynamically retrieves handlers, use the registerScopeHandlerFactory() method.
Parameters:
localElementName - the name of the element to handle
handler - the handler to use

registerScopeHandler

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. You should normally call this from ElementHandler.beginElement(). Handlers registered this way are static. To register a factory that dynamically retrieves handlers, use the registerScopeHandlerFactory() method.
Parameters:
namespaceURI - the namespace URI of the element to handle
localElementName - the name of the element to handle
handler - the handler to use

registerScopeHandlerFactory

void registerScopeHandlerFactory(ElementHandlerFactory factory)
Register a factory that can dynamically retrieve element handlers for XML elements in the current scope.
Parameters:
factory - the factory to register

getLocalName

java.lang.String getLocalName()
Get the local name of the current element.
Returns:
the local name of the current element.

getNamespaceURI

java.lang.String getNamespaceURI()
Get the namespace URI of the current element.
Returns:
the namespace URI of the current element.

getParentLocalName

java.lang.String getParentLocalName()
Get the local name of the parent element, if any.
Returns:
the local name of the parent element, or the empty string if this element is the root.

getValue

java.lang.Object getValue(Key key)
Get a value stored in this context.
Parameters:
key - a key for the stored value
Returns:
the stored value, or null if no such value is stored, or the value is stored as null.

putValue

void putValue(Key key,
              java.lang.Object value)
Store a value in this context.
Parameters:
key - a key for the value.
value - the value to store, can be null.

removeValue

void removeValue(Key key)
Clear a value from this context. This *only* acts on the current scope level.

getLocator

XMLLocator getLocator()
Get the locator for the XML file being parsed.
Returns:
the locator for the XML file being parsed

getMessageReporter

MessageReporter getMessageReporter()
Get the message reporter. Normally you only use this for reporting warnings; any thrown HandlerExceptions will be reported automatically.
Returns:
the parse message reporter.

setMessageReporter

void setMessageReporter(MessageReporter reporter)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.