|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.aries.blueprint.testbundlea.NSHandlerOne
public class NSHandlerOne
A simple example namespace handler, that understands an element, and 2 attributes When the element is encountered in a top level blueprint element, the handler will add a passthroughmetadata with it's id as the contained attribone. The passthroughmetadata will return a string with the value from the contained attrib two. If the element is encountered during processing of a bean, it will add a property to the bean with the name of the attribone value, and a value of the passthroughmetadata with id matching attribtwo This handler is designed to exercise aspects of the NamespaceHandler capability set.
Field Summary | |
---|---|
static java.lang.String |
NSURI
|
Constructor Summary | |
---|---|
NSHandlerOne()
|
Method Summary | |
---|---|
ComponentMetadata |
decorate(org.w3c.dom.Node node,
ComponentMetadata component,
ParserContext context)
Process a child node of an enclosing blueprint component. |
java.util.Set<java.lang.Class> |
getManagedClasses()
Specify a set of classes that must be consistent between a blueprint bundle and this namespace handler The blueprint extender will not invoke a namespace handler if any of the managed classes are inconsistent with the class space of the blueprint bundle (i.e. |
java.net.URL |
getSchemaLocation(java.lang.String namespace)
Retrieve a URL from where the schema for a given namespace can be retrieved |
Metadata |
parse(org.w3c.dom.Element element,
ParserContext context)
Parse a stand-alone blueprint component Given an Element node as a root, this method parses the stand-alone component and returns its
metadata. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String NSURI
Constructor Detail |
---|
public NSHandlerOne()
Method Detail |
---|
public ComponentMetadata decorate(org.w3c.dom.Node node, ComponentMetadata component, ParserContext context)
NamespaceHandler
ComponentMetadata
instance, this will replace the argument
ComponentMetadata
in subsequent parsing and namespace handler invocations. A namespace
handler that elects to return a new ComponentMetadata
instance should
ensure that existing interceptors are registered against the new instance if appropriate.
Due to the interaction with interceptors, a namespace handler should prefer to change a component metadata
instead of returning a new instance wherever possible. This can be achieved by casting a
ComponentMetadata
to its corresponding MutabableComponentMetadata
instance.
Note however that a given ComponentMetadata
instance cannot be guaranteed to implement
the mutable interface if it was constructed by an agent other than the blueprint extender.
decorate
in interface NamespaceHandler
node
- The node associated with this NamespaceHandler that should be used to decorate the enclosing
componentcomponent
- The enclosing blueprint componentcontext
- The parser context
public Metadata parse(org.w3c.dom.Element element, ParserContext context)
NamespaceHandler
Element
node as a root, this method parses the stand-alone component and returns its
metadata. The supplied ParserContext
should be used to parse embedded blueprint elements as well
as creating metadata.
parse
in interface NamespaceHandler
element
- The DOM element representing the custom componentcontext
- The ParserContext
for parsing sub-components and creating metadata objects
MutableMetadata
type to enable further decoration by other namespace handlerspublic java.net.URL getSchemaLocation(java.lang.String namespace)
NamespaceHandler
getSchemaLocation
in interface NamespaceHandler
namespace
- The schema's namespace
public java.util.Set<java.lang.Class> getManagedClasses()
NamespaceHandler
getManagedClasses
in interface NamespaceHandler
Set
of classes that must be compatible with any blueprint bundle for which this namespace
handler is to apply or null
if no compatibility checks are to be performed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |