public class ParserContextImpl extends Object implements ParserContext
Constructor and Description |
---|
ParserContextImpl(Parser parser,
ComponentDefinitionRegistry componentDefinitionRegistry,
org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent,
Node sourceNode) |
Modifier and Type | Method and Description |
---|---|
<T extends org.osgi.service.blueprint.reflect.Metadata> |
createMetadata(Class<T> type)
Create a new metadata instance of the given type.
|
String |
generateId()
Generate a unique id following the same scheme that the blueprint container
uses internally
|
ComponentDefinitionRegistry |
getComponentDefinitionRegistry() |
String |
getDefaultActivation()
Get the default activation setting for the current blueprint file
|
String |
getDefaultAvailability()
Get the default availability setting for the current blueprint file
|
String |
getDefaultTimeout()
Get the default timeout setting for the current blueprint file
|
org.osgi.service.blueprint.reflect.ComponentMetadata |
getEnclosingComponent()
Retrieve the
ComponentMetadata of the component that
encloses the current Node that is to be parsed by a
namespace handler. |
NamespaceHandler |
getNamespaceHandler(URI namespaceUri)
Retrieve the namespace handler for the given uri
|
Parser |
getParser() |
Node |
getSourceNode()
Returns the DOM Node that was passed to the NamespaceHandler call for which
this ParserContext instance was created.
|
<T> T |
parseElement(Class<T> type,
org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent,
Element element)
Invoke the blueprint parser to parse a DOM element.
|
public ParserContextImpl(Parser parser, ComponentDefinitionRegistry componentDefinitionRegistry, org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent, Node sourceNode)
public ComponentDefinitionRegistry getComponentDefinitionRegistry()
getComponentDefinitionRegistry
in interface ParserContext
public org.osgi.service.blueprint.reflect.ComponentMetadata getEnclosingComponent()
ParserContext
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
.getEnclosingComponent
in interface ParserContext
public Node getSourceNode()
ParserContext
getSourceNode
in interface ParserContext
public <T extends org.osgi.service.blueprint.reflect.Metadata> T createMetadata(Class<T> type)
ParserContext
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.createMetadata
in interface ParserContext
T
- The expected Metadata type to be createdtype
- the class of the Metadata object to createpublic <T> T parseElement(Class<T> type, org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent, Element element)
ParserContext
parseElement
in interface ParserContext
T
- The expected metadata type to be parsedtype
- the class of the Metadata type to be parsedenclosingComponent
- The component metadata that contains the Element
to be parsedelement
- The DOM element that is to be parsedpublic Parser getParser()
public String generateId()
ParserContext
generateId
in interface ParserContext
public String getDefaultActivation()
ParserContext
getDefaultActivation
in interface ParserContext
public String getDefaultAvailability()
ParserContext
getDefaultAvailability
in interface ParserContext
public String getDefaultTimeout()
ParserContext
getDefaultTimeout
in interface ParserContext
public NamespaceHandler getNamespaceHandler(URI namespaceUri)
ParserContext
getNamespaceHandler
in interface ParserContext
Copyright © 2016. All rights reserved.