org.apache.aries.blueprint
Interface ParserContext

All Known Implementing Classes:
ParserContextImpl

public interface ParserContext


Method Summary
<T extends Metadata>
T
createMetadata(java.lang.Class<T> type)
          Create a new metadata instance of the given type.
 java.lang.String generateId()
          Generate a unique id following the same scheme that the blueprint container uses internally
 ComponentDefinitionRegistry getComponentDefinitionRegistry()
           
 java.lang.String getDefaultActivation()
          Get the default activation setting for the current blueprint file
 java.lang.String getDefaultAvailability()
          Get the default availability setting for the current blueprint file
 java.lang.String getDefaultTimeout()
          Get the default timeout setting for the current blueprint file
 ComponentMetadata getEnclosingComponent()
          Retrieve the ComponentMetadata of the component that encloses the current Node that is to be parsed by a namespace handler.
 org.w3c.dom.Node getSourceNode()
          Returns the DOM Node that was passed to the NamespaceHandler call for which this ParserContext instance was created.
<T> T
parseElement(java.lang.Class<T> type, ComponentMetadata enclosingComponent, org.w3c.dom.Element element)
          Invoke the blueprint parser to parse a DOM element.
 

Method Detail

getSourceNode

org.w3c.dom.Node getSourceNode()
Returns the DOM Node that was passed to the NamespaceHandler call for which this ParserContext instance was created.


getComponentDefinitionRegistry

ComponentDefinitionRegistry getComponentDefinitionRegistry()

getEnclosingComponent

ComponentMetadata getEnclosingComponent()
Retrieve the ComponentMetadata of the component that encloses the current Node that is to be parsed by a namespace handler. In case of top-level components this method will return null.


createMetadata

<T extends Metadata> T createMetadata(java.lang.Class<T> type)
Create a new metadata instance of the given type. The returned object will also implement the appropriate MutableComponentMetadata interface, so as to allow the caller to set the properties of the metadata. Note that the returned object may not be initialised, so callers should take care to assure every property needed by the blueprint extender is set.

Type Parameters:
T - The expected Metadata type to be created
Parameters:
type - the class of the Metadata object to create
Returns:
a new instance

parseElement

<T> T parseElement(java.lang.Class<T> type,
                   ComponentMetadata enclosingComponent,
                   org.w3c.dom.Element element)
Invoke the blueprint parser to parse a DOM element.

Type Parameters:
T - The expected metadata type to be parsed
Parameters:
type - the class of the Metadata type to be parsed
enclosingComponent - The component metadata that contains the Element to be parsed
element - The DOM element that is to be parsed

generateId

java.lang.String generateId()
Generate a unique id following the same scheme that the blueprint container uses internally


getDefaultActivation

java.lang.String getDefaultActivation()
Get the default activation setting for the current blueprint file


getDefaultAvailability

java.lang.String getDefaultAvailability()
Get the default availability setting for the current blueprint file


getDefaultTimeout

java.lang.String getDefaultTimeout()
Get the default timeout setting for the current blueprint file



Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.