Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.config.xml
Class DefaultProcessingContext

java.lang.Object
  extended by com.tangosol.config.xml.DefaultProcessingContext

All Implemented Interfaces:
ProcessingContext, ResourceResolver

public class DefaultProcessingContext
extends java.lang.Object
implements ProcessingContext

The default implementation of a ProcessingContext.

Since:
Coherence 12.1.2
Author:
bo 2011.06.14

Constructor Summary
DefaultProcessingContext()
          Constructs a root ProcessingContext using default DocumentProcessor DocumentProcessor.Dependencies.
DefaultProcessingContext(DefaultProcessingContext ctxParent, XmlElement xmlElement)
          Constructs a sub-ProcessingContext of another ProcessingContext.
DefaultProcessingContext(DocumentProcessor.Dependencies dependencies)
          Constructs a root ProcessingContext with the specified DocumentProcessor DocumentProcessor.Dependencies.
DefaultProcessingContext(DocumentProcessor.Dependencies dependencies, XmlElement xmlElement)
          Constructs a root ProcessingContext for a given XmlElement.
DefaultProcessingContext(XmlElement xmlElement)
          Constructs a root ProcessingContext for a given XmlElement using default DocumentProcessor dependencies.

 

Method Summary
 void addCookie(java.lang.Class clzCookie, java.lang.String sName, java.lang.Object value)
          Adds the specified named and typed cookie to the ProcessingContext.
 void addCookie(java.lang.Class clzCookie, java.lang.Object cookie)
          Adds the specified cookie to the ProcessingContext.
 void definePropertyPath(java.lang.String sBeanPropertyName, java.lang.String sXmlPath)
          Defines the xml path to locate a specific Java Bean property with in an XmlElement in the ProcessingContext.
 NamespaceHandler ensureNamespaceHandler(java.lang.String sPrefix, NamespaceHandler handler)
          Ensures that the specified NamespaceHandler for the specified prefix is defined in this ProcessingContext.
 NamespaceHandler ensureNamespaceHandler(java.lang.String sPrefix, java.net.URI uri)
          Ensures that an NamespaceHandler with the specified URI is available for use in the ProcessingContext with the specified prefix.
 java.lang.ClassLoader getContextClassLoader()
          Obtains the ClassLoader to use for loading classes in the ProcessingContext.
 java.lang.Object getCookie(java.lang.Class clzCookie)
          Locates and returns the cookie with the specified type.
 java.lang.Object getCookie(java.lang.Class clzCookie, java.lang.String sName)
          Locates and returns the cookie with the specified type and name.
 com.tangosol.config.expression.ParameterResolver getDefaultParameterResolver()
          Obtains the ParameterResolver to use for resolving parameters defined externally to the document being processed (ie: the operating system or container)
 DocumentProcessor.Dependencies getDependencies()
          Obtains the DocumentProcessor DocumentProcessor.Dependencies for the ProcessingContext.
 com.tangosol.config.expression.ExpressionParser getExpressionParser()
          Obtains the configured ExpressionParser for this ProcessingContext.
 java.lang.Object getMandatoryProperty(java.lang.String sPath, java.lang.reflect.Type typeProperty, XmlElement xmlParent)
          Obtains the strongly typed value for the property defined at the path relative to the specified XmlElement.
 NamespaceHandler getNamespaceHandler(java.lang.String sPrefix)
          Obtains the NamespaceHandler which is capable of processing the namespace with the specified prefix.
 NamespaceHandler getNamespaceHandler(java.net.URI uri)
          Obtains the NamespaceHandler that is capable of processing the namespace defined with the specified URI.
 java.lang.Iterable getNamespaceHandlers()
          Obtains the NamespaceHandlers that are currently in scope for this ProcessingContext.
 java.net.URI getNamespaceURI(java.lang.String sPrefix)
          Obtains the URI that is associated with the specified prefix.
 java.lang.Object getOptionalProperty(java.lang.String sPropertyName, java.lang.reflect.Type typeProperty, java.lang.Object defaultValue, XmlElement xmlElement)
          Obtains the strongly typed value for the property defined at the path relative to the specified XmlElement.
 com.tangosol.config.expression.Value getPropertyValue(java.lang.String sPropertyName, java.lang.reflect.Type typeProperty, XmlElement xmlParent, boolean fOnlyUsePropertyName)
          Attempts to resolve the named property of the specified type in the current context and if required will parse the specified XmlElement in order to do so.
 java.lang.Object getResource(java.lang.Class clsResource)
          Attempts to retrieve the resource that was registered with the specified class.
 java.lang.Object getResource(java.lang.Class clsResource, java.lang.String sResourceName)
          Attempts to retrieve the resource that was registered with the specified class and name.
 ResourceRegistry getResourceRegistry()
          Obtains the ResourceRegistry associated with the ProcessingContext.
 java.lang.Object inject(java.lang.Object bean, XmlElement xmlElement)
          Given the information available in the ProcessingContext, including the cookies, the ResourceRegistry the XmlElement, its XmlAttributes and/or children, inject appropriately named and typed values into the specified bean (using setter injection).
 boolean isPropertyDefined(java.lang.String sPropertyName, XmlElement xmlParent)
          Determines if the specified property is defined at the path relative to the specified XmlElement.
 boolean isRootContext()
          Determines if the ProcessingContext is the root.
 java.lang.Object processDocument(java.lang.String sXml)
          Request that the specified xml string (representing an xml document) be processed with appropriate NamespaceHandlers.
 java.lang.Object processDocument(XmlElement xmlElement)
          Request that the specified XmlElement (representing the root of an XmlDocument) be processed with appropriate NamespaceHandlers.
 java.lang.Object processDocumentAt(java.lang.String sLocation)
          Request that the document specified by the URI/filename (containing the root of an XmlDocument) be processed with appropriate NamespaceHandlers.
 java.lang.Object processDocumentAt(java.net.URI uri)
          Request that the document specified by the URI/filename (containing the root of an XmlDocument) be processed with appropriate NamespaceHandlers.
 java.lang.Object processElement(java.lang.String sXml)
          Request the specified xml string be processed with an appropriate NamespaceHandler known by the ProcessingContext.
 java.lang.Object processElement(XmlElement xmlElement)
          Request the specified XmlElement to be processed with an appropriate NamespaceHandler known by the ProcessingContext or outer ProcessingContexts.
 java.util.Map processElementsOf(XmlElement xmlElement)
          Request that all of the child elements contained with in the specified XmlElement be processed using appropriate NamespaceHandlers known by the ProcessingContext.
 java.util.Map processForeignElementsOf(XmlElement xmlElement)
          Request that all of the child elements contained within the specified XmlElement that do not belong to the namespace of the said XmlElement are processed using appropriate processes.
 java.lang.Object processOnlyElementOf(XmlElement xmlElement)
          Request that the only child element contained within the XmlElement is processed using an appropriate NamespaceHandler known by the ProcessingContext.
 java.lang.Object processRemainingElementOf(XmlElement xmlElement)
          Request that the last remaining unprocessed child element contained within the specified XmlElement is processed using an appropriate ElementProcessor.
 java.util.Map processRemainingElementsOf(XmlElement xmlElement)
          Request that the last remaining unprocessed children contained within the specified XmlElement are processed using appropriate ElementProcessors.
 void registerAttributeType(java.lang.Class clzType)
          Automatically creates and registers an AttributeProcessor for the specified type.
 void registerElementType(java.lang.Class clzType)
          Automatically creates and registers an ElementProcessor for the specified type.
 void registerProcessor(java.lang.Class clzType, AttributeProcessor processor)
          Registers an AttributeProcessor that may be used to process specific types of values contained in XmlAttributes with in the ProcessingContext.
 void registerProcessor(java.lang.Class clzType, ElementProcessor processor)
          Registers an ElementProcessor that may be used to process specific types of values contained in XmlElements with in the ProcessingContext.

 

Constructor Detail

DefaultProcessingContext

public DefaultProcessingContext()
Constructs a root ProcessingContext using default DocumentProcessor DocumentProcessor.Dependencies.

DefaultProcessingContext

public DefaultProcessingContext(DocumentProcessor.Dependencies dependencies)
Constructs a root ProcessingContext with the specified DocumentProcessor DocumentProcessor.Dependencies.
Parameters:
dependencies - the DocumentProcessor.Dependencies for the ProcessingContext

DefaultProcessingContext

public DefaultProcessingContext(XmlElement xmlElement)
Constructs a root ProcessingContext for a given XmlElement using default DocumentProcessor dependencies.
Parameters:
xmlElement - the XmlElement for the ProcessingContext

DefaultProcessingContext

public DefaultProcessingContext(DefaultProcessingContext ctxParent,
                                XmlElement xmlElement)
Constructs a sub-ProcessingContext of another ProcessingContext.
Parameters:
ctxParent - the parent ProcessingContext for this ProcessingContext
xmlElement - the XmlElement for the sub-ProcessingContext

DefaultProcessingContext

public DefaultProcessingContext(DocumentProcessor.Dependencies dependencies,
                                XmlElement xmlElement)
Constructs a root ProcessingContext for a given XmlElement.
Parameters:
dependencies - the DocumentProcessor.Dependencies for the ProcessingContext
xmlElement - the XmlElement for the ProcessingContext

Method Detail

getResource

public java.lang.Object getResource(java.lang.Class clsResource)
Attempts to retrieve the resource that was registered with the specified class.
Specified by:
getResource in interface ResourceResolver
Parameters:
clsResource - the class of the resource
Returns:
the registered resource or null if the resource is unknown to the ResourceRegistry

getResource

public java.lang.Object getResource(java.lang.Class clsResource,
                                    java.lang.String sResourceName)
Attempts to retrieve the resource that was registered with the specified class and name.
Specified by:
getResource in interface ResourceResolver
Parameters:
clsResource - the class of the resource
sResourceName - the name of the resource
Returns:
the registered resource or null if the resource is unknown to the ResourceRegistry

getResourceRegistry

public ResourceRegistry getResourceRegistry()
Obtains the ResourceRegistry associated with the ProcessingContext.
Specified by:
getResourceRegistry in interface ProcessingContext
Returns:
a ResourceRegistry

getDefaultParameterResolver

public com.tangosol.config.expression.ParameterResolver getDefaultParameterResolver()
Obtains the ParameterResolver to use for resolving parameters defined externally to the document being processed (ie: the operating system or container)
Specified by:
getDefaultParameterResolver in interface ProcessingContext
Returns:
the default ParameterResolver.

getContextClassLoader

public java.lang.ClassLoader getContextClassLoader()
Obtains the ClassLoader to use for loading classes in the ProcessingContext.
Specified by:
getContextClassLoader in interface ProcessingContext
Returns:
ClassLoader

addCookie

public void addCookie(java.lang.Class clzCookie,
                      java.lang.String sName,
                      java.lang.Object value)
Adds the specified named and typed cookie to the ProcessingContext.

If a cookie with the same name and type exists in the ProcessingContext, it will be replaced by the specified cookie. If a cookie with the same name and type has been defined in an outer ProcessingContext, the specified cookie will hide the cookie defined in the outer ProcessingContext.

Specified by:
addCookie in interface ProcessingContext
Parameters:
clzCookie - the class of the cookie
sName - the name of the cookie
value - the cookie value

addCookie

public void addCookie(java.lang.Class clzCookie,
                      java.lang.Object cookie)
Adds the specified cookie to the ProcessingContext.

If a cookie of the same type and name (being the name of the class of the said cookie) is already registered with the ProcessingContext, it will be replaced by the specified cookie.

If a cookie of the same type and name has been defined in an outer ProcessingContext, the specified cookie will hide the cookie defined in the outer ProcessingContext.

This method is equivalent to calling: addCookie(clz, clz.getName(), cookie);

Specified by:
addCookie in interface ProcessingContext
Parameters:
clzCookie - the class of the cookie
cookie - the cookie value

getCookie

public java.lang.Object getCookie(java.lang.Class clzCookie,
                                  java.lang.String sName)
Locates and returns the cookie with the specified type and name.

Locating the cookie involves searching the current ProcessingContext for a matching cookie. If one is not found, the search continues with outer ProcessingContexts until a cookie is either located or there are no more ProcessingContexts, in which case null is returned.

Specified by:
getCookie in interface ProcessingContext
Parameters:
clzCookie - the class of the cookie
sName - the name of the cookie
Returns:
the cookie or null if not defined

getCookie

public java.lang.Object getCookie(java.lang.Class clzCookie)
Locates and returns the cookie with the specified type.

Locating the cookie involves searching the current ProcessingContext for a matching cookie. If one is not found, the search continues with outer ProcessingContexts until a cookie is either located or there are no more ProcessingContexts, in which case null is returned.

This method is equivalent to calling: getCookie(clz, clz.getName());

Specified by:
getCookie in interface ProcessingContext
Parameters:
clzCookie - the class of the cookie
Returns:
the cookie or null if not defined

definePropertyPath

public void definePropertyPath(java.lang.String sBeanPropertyName,
                               java.lang.String sXmlPath)
Defines the xml path to locate a specific Java Bean property with in an XmlElement in the ProcessingContext.

This method allows "alias" paths for Java Bean properties to be defined so that ProcessingContext.inject(Object, XmlElement) calls may resolve property values correctly.

This is an advanced feature. Typically this is only used when:

  1. A Java Bean property name does not match a named value, XmlElement or XmlAttribute with in a ProcessingContext.
  2. A Java Bean property can not be located with in the ProcessingContext.
    Specified by:
    definePropertyPath in interface ProcessingContext
    Parameters:
    sBeanPropertyName - the property name of the bean
    sXmlPath - the xmlPath to the property value

    registerProcessor

    public void registerProcessor(java.lang.Class clzType,
                                  AttributeProcessor processor)
    
    Registers an AttributeProcessor that may be used to process specific types of values contained in XmlAttributes with in the ProcessingContext.

    When an AttributeProcessor isn't provided by the associated NamespaceHandler for an XmlAttribute, an attempt is made to use a type specific AttributeProcessor to process an XmlAttribute for injection (with ProcessingContext.inject(Object, XmlElement)).

    Specified by:
    registerProcessor in interface ProcessingContext
    Parameters:
    clzType - the Class type
    processor - the AttributeProcessor for the type

    registerProcessor

    public void registerProcessor(java.lang.Class clzType,
                                  ElementProcessor processor)
    
    Registers an ElementProcessor that may be used to process specific types of values contained in XmlElements with in the ProcessingContext.

    When an ElementProcessor isn't provided by the associated NamespaceHandler for an XmlElement, an attempt is made to use a type specific ElementProcessor to process an XmlElement for injection (with ProcessingContext.inject(Object, XmlElement)).

    Specified by:
    registerProcessor in interface ProcessingContext
    Parameters:
    clzType - the Class type
    processor - the ElementProcessor for the type

    registerAttributeType

    public void registerAttributeType(java.lang.Class clzType)
    
    Automatically creates and registers an AttributeProcessor for the specified type.

    Note: This assumes the type supports a String-based or XmlAttribute-based constructor.

    Specified by:
    registerAttributeType in interface ProcessingContext
    Parameters:
    clzType - the type for which to create and register an AttributeProcessor

    registerElementType

    public void registerElementType(java.lang.Class clzType)
    
    Automatically creates and registers an ElementProcessor for the specified type.

    Note: This assumes the type supports a String-based or XmlElement-based constructor.

    Specified by:
    registerElementType in interface ProcessingContext
    Parameters:
    clzType - the type for which to create and register an ElementProcessor

    getExpressionParser

    public com.tangosol.config.expression.ExpressionParser getExpressionParser()
    
    Obtains the configured ExpressionParser for this ProcessingContext.
    Specified by:
    getExpressionParser in interface ProcessingContext
    Returns:
    the ExpressionParser

    processDocument

    public java.lang.Object processDocument(XmlElement xmlElement)
                                     throws ConfigurationException
    
    Request that the specified XmlElement (representing the root of an XmlDocument) be processed with appropriate NamespaceHandlers.

    Should the document root contain any unrecognized xml namespaces, an attempt will be made to load appropriate NamespaceHandlers that of which will be used to process said elements in the document.

    Specified by:
    processDocument in interface ProcessingContext
    Parameters:
    xmlElement - the root XmlElement of the XmlDocument to process
    Returns:
    the result of the processing the root element of the document represented by the XmlElement
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processDocumentAt

    public java.lang.Object processDocumentAt(java.net.URI uri)
                                       throws ConfigurationException
    
    Request that the document specified by the URI/filename (containing the root of an XmlDocument) be processed with appropriate NamespaceHandlers.

    Should the document root contain any unrecognized xml namespaces, an attempt will be made to load appropriate NamespaceHandlers that of which will be used to process said elements in the document.

    Specified by:
    processDocumentAt in interface ProcessingContext
    Parameters:
    uri - the URI of the XmlDocument to process
    Returns:
    the result of the processing the root element of the document
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processDocumentAt

    public java.lang.Object processDocumentAt(java.lang.String sLocation)
                                       throws ConfigurationException
    
    Request that the document specified by the URI/filename (containing the root of an XmlDocument) be processed with appropriate NamespaceHandlers.

    Should the document root contain any unrecognized xml namespaces, an attempt will be made to load appropriate NamespaceHandlers that of which will be used to process said elements in the document.

    Specified by:
    processDocumentAt in interface ProcessingContext
    Parameters:
    sLocation - the URI/filename of the XmlDocument to process
    Returns:
    the result of the processing the root element of the document
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processDocument

    public java.lang.Object processDocument(java.lang.String sXml)
                                     throws ConfigurationException
    
    Request that the specified xml string (representing an xml document) be processed with appropriate NamespaceHandlers.

    Should the document root contain any unrecognized xml namespaces, an attempt will be made to load appropriate NamespaceHandlers that of which will be used to process said elements in the document.

    Specified by:
    processDocument in interface ProcessingContext
    Parameters:
    sXml - a string containing an xml document to process
    Returns:
    the result of processing the root element of the document
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processElement

    public java.lang.Object processElement(XmlElement xmlElement)
                                    throws ConfigurationException
    
    Request the specified XmlElement to be processed with an appropriate NamespaceHandler known by the ProcessingContext or outer ProcessingContexts.

    Note: Should the element contain any unrecognized xml namespaces, an attempt will be made to load appropriate NamespaceHandlers that of which will be used to process said elements.

    Specified by:
    processElement in interface ProcessingContext
    Parameters:
    xmlElement - the XmlElement to process
    Returns:
    the result of processing the XmlElement with an appropriate ElementProcessor
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processElement

    public java.lang.Object processElement(java.lang.String sXml)
                                    throws ConfigurationException
    
    Request the specified xml string be processed with an appropriate NamespaceHandler known by the ProcessingContext.

    Note: Should the element contain any unrecognized xml namespaces, an attempt will be made to load appropriate NamespaceHandlers that of which will be used to process said elements.

    Specified by:
    processElement in interface ProcessingContext
    Parameters:
    sXml - the xml to process
    Returns:
    the result of processing the root element of the specified xml
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processOnlyElementOf

    public java.lang.Object processOnlyElementOf(XmlElement xmlElement)
                                          throws ConfigurationException
    
    Request that the only child element contained within the XmlElement is processed using an appropriate NamespaceHandler known by the ProcessingContext.
    Specified by:
    processOnlyElementOf in interface ProcessingContext
    Parameters:
    xmlElement - the XmlElement in which the child is defined
    Returns:
    the result of processing the child element
    Throws:
    ConfigurationException - when a configuration problem was encountered, especially if there is zero or more than one child

    processElementsOf

    public java.util.Map processElementsOf(XmlElement xmlElement)
                                    throws ConfigurationException
    
    Request that all of the child elements contained with in the specified XmlElement be processed using appropriate NamespaceHandlers known by the ProcessingContext.

    This is a convenience method to aid in the processing of all children of an XmlElement. The keys of the returned Map represent the id attributes each child XmlElement. If an XmlElement does not have a specified id attribute, a UUID is generated in it's place.

    Specified by:
    processElementsOf in interface ProcessingContext
    Parameters:
    xmlElement - the parent XmlElement of the children to process
    Returns:
    a Map from identifiable child XmlElements (with id="O___" attributes) and their corresponding processed values
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processForeignElementsOf

    public java.util.Map processForeignElementsOf(XmlElement xmlElement)
                                           throws ConfigurationException
    
    Request that all of the child elements contained within the specified XmlElement that do not belong to the namespace of the said XmlElement are processed using appropriate processes.

    This is a convenience method to aid in the processing of all children of an XmlElement. The keys of the returned Map represent the id attributes each child XmlElement. If an XmlElement does not have a specified id attribute, a UUID is generated in it's place.

    Specified by:
    processForeignElementsOf in interface ProcessingContext
    Parameters:
    xmlElement - the parent XmlElement of the children to process
    Returns:
    a Map from identifiable child XmlElements (with attributes) and their corresponding processed values
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processRemainingElementsOf

    public java.util.Map processRemainingElementsOf(XmlElement xmlElement)
                                             throws ConfigurationException
    
    Request that the last remaining unprocessed children contained within the specified XmlElement are processed using appropriate ElementProcessors.

    This is a convenience method to aid in the processing of an unprocessed child XmlElements of an element. The keys of the returned Map represent the id attributes each child XmlElement. If an XmlElement does not have a specified id attribute, a UUID is generated in it's place.

    Specified by:
    processRemainingElementsOf in interface ProcessingContext
    Parameters:
    xmlElement - the parent XmlElement of the unprocessed children to process
    Returns:
    a Map from identifiable child XmlElements (with attributes) and their corresponding processed values
    Throws:
    ConfigurationException - when a configuration problem was encountered

    processRemainingElementOf

    public java.lang.Object processRemainingElementOf(XmlElement xmlElement)
                                               throws ConfigurationException
    
    Request that the last remaining unprocessed child element contained within the specified XmlElement is processed using an appropriate ElementProcessor.

    This is a convenience method to aid in the processing of an unprocessed child XmlElement of an element.

    Specified by:
    processRemainingElementOf in interface ProcessingContext
    Parameters:
    xmlElement - the parent XmlElement of the unprocessed child to process
    Returns:
    the result of processing the child element
    Throws:
    ConfigurationException - if there are zero or more than one unprocessed child in the element, or if some other ConfigurationException occurred

    isPropertyDefined

    public boolean isPropertyDefined(java.lang.String sPropertyName,
                                     XmlElement xmlParent)
                              throws ConfigurationException
    
    Determines if the specified property is defined at the path relative to the specified XmlElement.
    Specified by:
    isPropertyDefined in interface ProcessingContext
    Parameters:
    sPropertyName - the path to the property
    xmlParent - the XmlElement in which the property should be searched
    Returns:
    true if the property is defined, false otherwise
    Throws:
    ConfigurationException - if a configuration is not valid

    inject

    public java.lang.Object inject(java.lang.Object bean,
                                   XmlElement xmlElement)
                            throws ConfigurationException
    
    Given the information available in the ProcessingContext, including the cookies, the ResourceRegistry the XmlElement, its XmlAttributes and/or children, inject appropriately named and typed values into the specified bean (using setter injection).

    The order in which values are located for injection is as follows; attributed defined by the element, child elements defined by the element, alternative paths to values defined in the ProcessingContext, cookies defined by the ProcessingContext and finally the ResourceRegistry associated with the ProcessingContext.

    Specified by:
    inject in interface ProcessingContext
    Parameters:
    bean - the bean to be injected
    xmlElement - the XmlElement from which values will be derived for injection into the bean
    Returns:
    the provided bean but with properties set based on the available values in the ProcessingContext
    Throws:
    ConfigurationException - if a configuration is not valid

    getMandatoryProperty

    public java.lang.Object getMandatoryProperty(java.lang.String sPath,
                                                 java.lang.reflect.Type typeProperty,
                                                 XmlElement xmlParent)
                                          throws ConfigurationException
    
    Obtains the strongly typed value for the property defined at the path relative to the specified XmlElement. If the property is not defined or is of the incorrect type, a ConfigurationException is thrown.
    Specified by:
    getMandatoryProperty in interface ProcessingContext
    Parameters:
    sPath - the path to the property
    typeProperty - the type of the property
    xmlParent - the XmlElement containing the properties for the object
    Returns:
    the property value
    Throws:
    ConfigurationException - if a configuration is not valid, the property can't be located or is of the wrong type

    getOptionalProperty

    public java.lang.Object getOptionalProperty(java.lang.String sPropertyName,
                                                java.lang.reflect.Type typeProperty,
                                                java.lang.Object defaultValue,
                                                XmlElement xmlElement)
                                         throws ConfigurationException
    
    Obtains the strongly typed value for the property defined at the path relative to the specified XmlElement. If the property is not defined, the defaultValue is returned.
    Specified by:
    getOptionalProperty in interface ProcessingContext
    Parameters:
    sPropertyName - the path to the property
    typeProperty - the type of the property
    defaultValue - the value to return if the property is not found
    xmlElement - the XmlElement containing the properties for the object
    Returns:
    the property value
    Throws:
    ConfigurationException - if a configuration is not valid

    ensureNamespaceHandler

    public NamespaceHandler ensureNamespaceHandler(java.lang.String sPrefix,
                                                   NamespaceHandler handler)
                                            throws ConfigurationException
    
    Ensures that the specified NamespaceHandler for the specified prefix is defined in this ProcessingContext.

    If a NamespaceHandler for the prefix does not exist in the ProcessingContext, it is added. Otherwise the existing NamespaceHandler for the prefix is returned.

    Specified by:
    ensureNamespaceHandler in interface ProcessingContext
    Parameters:
    sPrefix - the prefix of the xml Namespace to be associated with the NamespaceHandler
    handler - the NamespaceHandler
    Returns:
    the registered NamespaceHandler for the ProcessingContext
    Throws:
    ConfigurationException

    ensureNamespaceHandler

    public NamespaceHandler ensureNamespaceHandler(java.lang.String sPrefix,
                                                   java.net.URI uri)
                                            throws ConfigurationException
    
    Ensures that an NamespaceHandler with the specified URI is available for use in the ProcessingContext with the specified prefix. If a NamespaceHandler with the specified prefix and URI is not defined by the ProcessingContext, one is instantiated, registered and returned.
    Specified by:
    ensureNamespaceHandler in interface ProcessingContext
    Parameters:
    sPrefix - the prefix of the Xml Namespace to use for the NamespaceHandler
    uri - the URI detailing the location of the NamespaceHandler. Typically this will be a java class URI, specified as "class://fully.qualified.class.name"
    Returns:
    an instance of the NamespaceHandler that is suitable for processing the prefix and URI
    Throws:
    ConfigurationException - when a configuration problem was encountered

    getNamespaceHandler

    public NamespaceHandler getNamespaceHandler(java.lang.String sPrefix)
    
    Obtains the NamespaceHandler which is capable of processing the namespace with the specified prefix.
    Specified by:
    getNamespaceHandler in interface ProcessingContext
    Parameters:
    sPrefix - the prefix of the xml namespace
    Returns:
    null if a NamespaceHandler could not be located for the specified prefix

    getNamespaceHandler

    public NamespaceHandler getNamespaceHandler(java.net.URI uri)
    
    Obtains the NamespaceHandler that is capable of processing the namespace defined with the specified URI.
    Specified by:
    getNamespaceHandler in interface ProcessingContext
    Parameters:
    uri - the Xml Namespace URI of the NamespaceHandler to locate
    Returns:
    null if a NamespaceHandler could not be located for the specified URI

    getNamespaceURI

    public java.net.URI getNamespaceURI(java.lang.String sPrefix)
    
    Obtains the URI that is associated with the specified prefix.
    Specified by:
    getNamespaceURI in interface ProcessingContext
    Parameters:
    sPrefix - the XML namespace prefix of the URI to locate
    Returns:
    null if a URI could not be located for the specified URI

    getNamespaceHandlers

    public java.lang.Iterable getNamespaceHandlers()
    
    Obtains the NamespaceHandlers that are currently in scope for this ProcessingContext.
    Specified by:
    getNamespaceHandlers in interface ProcessingContext
    Returns:
    An Iterable over the NamespaceHandlers in scope.

    getDependencies

    public DocumentProcessor.Dependencies getDependencies()
    
    Obtains the DocumentProcessor DocumentProcessor.Dependencies for the ProcessingContext.
    Returns:
    the DocumentProcessor.Dependencies

    getPropertyValue

    public com.tangosol.config.expression.Value getPropertyValue(java.lang.String sPropertyName,
                                                                 java.lang.reflect.Type typeProperty,
                                                                 XmlElement xmlParent,
                                                                 boolean fOnlyUsePropertyName)
                                                          throws ConfigurationException
    
    Attempts to resolve the named property of the specified type in the current context and if required will parse the specified XmlElement in order to do so.
    Parameters:
    sPropertyName - the name or xml path to the property
    typeProperty - the required type of the property value
    xmlParent - the parent element in which the property may be found
    fOnlyUsePropertyName - when true the specified property name must be used resolve the property value. when false attempts may be made to resolve the property just the type name if the specified property name doesn't resolve a property
    Returns:
    The Value representing the property or null if the property could not be located
    Throws:
    ConfigurationException - if the property was but could not be processed or is of the incorrect type

    isRootContext

    public boolean isRootContext()
    
    Determines if the ProcessingContext is the root. ie: has no parent.
    Returns:
    true if the ProcessingContext is the root scope, false otherwise

    Oracle® Fusion Middleware Java API Reference for Oracle Coherence
    12c (12.1.3.0.0)

    E47890-01

    Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.