java.lang.Object | |||
↳ | org.apache.commons.betwixt.Descriptor | ||
↳ | org.apache.commons.betwixt.NodeDescriptor | ||
↳ | org.apache.commons.betwixt.ElementDescriptor |
ElementDescriptor
describes the XML elements
to be created for a bean instance.
It contains AttributeDescriptor
's for all it's attributes
and ElementDescriptor
's for it's child elements.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an
ElementDescriptor that refers to a primitive type. | |||||||||||
This constructor is deprecated.
0.6 PrimitiveType property has been removed
| |||||||||||
Creates a ElementDescriptor with no namespace URI or prefix.
| |||||||||||
Creates a
ElementDescriptor with namespace URI and qualified name |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds an attribute to the element this
ElementDescriptor describes | |||||||||||
Adds a descriptor for child content.
| |||||||||||
Adds a descriptor for a child element.
| |||||||||||
Finds the parent of the given descriptor.
| |||||||||||
Returns an attribute descriptor with a given name or null.
| |||||||||||
Returns the attribute descriptors for this element
| |||||||||||
Returns descriptors for the child content of the element this describes.
| |||||||||||
Returns the expression used to evaluate the new context of this element.
| |||||||||||
Gets a child ElementDescriptor matching the given name if one exists.
| |||||||||||
Returns descriptors for the child elements of the element this describes.
| |||||||||||
Gets the class which should be used for instantiation.
| |||||||||||
Gets the primary descriptor for body text of this element. | |||||||||||
Returns true if this element has
AttributeDescriptors | |||||||||||
Returns true if this element has child
ElementDescriptors | |||||||||||
Returns true if this element has child content.
| |||||||||||
Does this describe a collective?
| |||||||||||
Is this decriptor hollow? A hollow descriptor is one which gives only the class that the subgraph is mapped to rather than describing the entire subgraph. | |||||||||||
Is this a polymorphic element? A polymorphic element's name is not fixed at introspection time and it's resolution is postponed to bind time. | |||||||||||
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
| |||||||||||
Is this a simple element? A simple element is one without child elements or attributes. | |||||||||||
Is the bind time type to be used to determine the mapping? The mapping for an object property value can either be the introspection time type (based on the logical type of the property) or the bind time type (based on the type of the actual instance). | |||||||||||
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
| |||||||||||
Removes an attribute descriptor from this element descriptor.
| |||||||||||
Removes an element descriptor from this element descriptor.
| |||||||||||
Sets the
AttributesDescriptors for this element. | |||||||||||
Sets whether the element described is a collective.
| |||||||||||
Sets the descriptors for the child content of the element this describes.
| |||||||||||
Sets the expression used to evaluate the new context of this element
| |||||||||||
Sets the descriptors for the child element of the element this describes.
| |||||||||||
Sets whether this descriptor is hollow.
| |||||||||||
Sets the class which should be used for instantiation.
| |||||||||||
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
| |||||||||||
Sets whether the bind time type to be used to determine the mapping. | |||||||||||
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
| |||||||||||
Returns something useful for logging.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Lazily creates the mutable List.
| |||||||||||
Lazily creates the mutable List of child content descriptors.
| |||||||||||
Lazily creates the mutable List of child elements.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.betwixt.NodeDescriptor
| |||||||||||
From class
org.apache.commons.betwixt.Descriptor
| |||||||||||
From class
java.lang.Object
|
Constructs an ElementDescriptor
that refers to a primitive type.
This constructor is deprecated.
0.6 PrimitiveType property has been removed
Base constructor.
primitiveType | if true, this element refers to a primitive type |
---|
Creates a ElementDescriptor with no namespace URI or prefix.
localName | the (xml) local name of this node. This will be used to set both qualified and local name for this name. |
---|
Creates a ElementDescriptor
with namespace URI and qualified name
localName | the (xml) local name of this node |
---|---|
qualifiedName | the (xml) qualified name of this node |
uri | the (xml) namespace prefix of this node |
Adds an attribute to the element this ElementDescriptor
describes
descriptor | the AttributeDescriptor that will be added to the
attributes associated with element this ElementDescriptor describes
|
---|
Adds a descriptor for child content.
descriptor | the Descriptor describing the child content to add |
---|
Adds a descriptor for a child element.
descriptor | the ElementDescriptor describing the child element to add
|
---|
Finds the parent of the given descriptor.
elementDescriptor | ElementDescriptor |
---|
ElementDescriptor
, not null
Returns an attribute descriptor with a given name or null.
name | to search for; will be checked against the attributes' qualified name. |
---|
AttributeDescriptor
with the given name,
or null if no descriptor has that nameReturns the attribute descriptors for this element
ElementDescriptor
describes
Returns descriptors for the child content of the element this describes.
Descriptor
describing the child elements
of the element that this ElementDescriptor
describesReturns the expression used to evaluate the new context of this element.
Gets a child ElementDescriptor matching the given name if one exists.
Note that (so long as there are no better matches), a null name
acts as a wildcard. In other words, an
ElementDescriptor
the first descriptor
with a null name will match any name
passed in, unless some other matches the name exactly.
name | the localname to be matched, not null |
---|
Returns descriptors for the child elements of the element this describes.
ElementDescriptor
describing the child elements
of the element that this ElementDescriptor
describes
Gets the class which should be used for instantiation.
Gets the primary descriptor for body text of this element. Betwixt collects all body text for any element together. This makes it rounds tripping difficult for beans that write more than one mixed content property.
The algorithm used in the default implementation is that the first TextDescriptor found amongst the descriptors is returned.
Returns true if this element has AttributeDescriptors
Returns true if this element has child ElementDescriptors
Returns true if this element has child content.
Does this describe a collective?
Is this decriptor hollow?
A hollow descriptor is one which gives only the class that the subgraph
is mapped to rather than describing the entire subgraph.
A new XMLBeanInfo
should be introspected
and that used to describe the subgraph.
A hollow descriptor should not have any child descriptors.
TODO: consider whether a subclass would be better
Is this a polymorphic element?
A polymorphic element's name is not fixed at introspection time and it's resolution is postponed to bind time.
getQualifiedName()
is null,
false otherwise
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
Returns true if this element refers to a primitive type property
Is this a simple element?
A simple element is one without child elements or attributes. This corresponds to the simple type concept used in XML Schema. TODO: need to consider whether it's sufficient to calculate which are simple types (and so don't get IDs assigned etc).
SimpleType
element
Is the bind time type to be used to determine the mapping?
The mapping for an object property value can either be the introspection time type (based on the logical type of the property) or the bind time type (based on the type of the actual instance).
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
Returns true if collective bean properties should wrap the items in a parent element.
In other words, should the mapping for bean properties which are Collection
s
enclosed the item elements within a parent element.
Normally only used when this describes a collection bean property.
Removes an attribute descriptor from this element descriptor.
descriptor | the AttributeDescriptor to be removed, not null |
---|
Removes an element descriptor from this element descriptor.
descriptor | the ElementDescriptor that will be removed. |
---|
Sets the AttributesDescriptors
for this element.
This sets descriptors for the attributes of the element describe by the
ElementDescriptor
.
attributeDescriptors | the AttributeDescriptor describe the attributes
of the element described by this ElementDescriptor
|
---|
Sets whether the element described is a collective.
Sets the descriptors for the child content of the element this describes.
contentDescriptors | the Descriptor s of the element
that this describes |
---|
Sets the expression used to evaluate the new context of this element
contextExpression | the expression used to evaluate the new context of this element |
---|
Sets the descriptors for the child element of the element this describes. Also sets the child content descriptors for this element
elementDescriptors | the ElementDescriptor s of the element
that this describes
|
---|
Sets whether this descriptor is hollow.
A hollow descriptor is one which gives only the class that the subgraph
is mapped to rather than describing the entire subgraph.
A new XMLBeanInfo
should be introspected
and that used to describe the subgraph.
A hollow descriptor should not have any child descriptors.
TODO: consider whether a subclass would be better
isHollow | true if this is hollow |
---|
Sets the class which should be used for instantiation.
implementationClass | the class which should be used for instantiation or null to use the mapped type |
---|
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
Sets whether this element refers to a primitive type (or property of a parent object)
primitiveType | true if this element refers to a primitive type |
---|
Sets whether the bind time type to be used to determine the mapping. The mapping for an object property value can either be the introspection time type (based on the logical type of the property) or the bind time type (based on the type of the actual instance).
Note: this property is write once, read many. So, the first time that this method is called the value will be set but subsequent calls will be ignored.
useBindTimeTypeForMapping | true if the bind time type is to be used to determine the mapping, false if the introspection time type is to be used |
---|
This method is deprecated.
0.6 moved to a declarative style of descriptors where the alrogithmic should
be done during introspection
Sets whether Collection
bean properties should wrap items in a parent element.
In other words, should the mapping for bean properties which are Collection
s
enclosed the item elements within a parent element.
Normally only used when this describes a collection bean property.
wrapCollectionsInElement | true if the elements for the items in the collection should be contained in a parent element |
---|
Lazily creates the mutable List. This nullifies the attributeDescriptors array so that as items are added to the list the Array is ignored until it is explicitly asked for.
AttributeDescriptors
's describing the attributes
of the element that this ElementDescriptor
describes
Lazily creates the mutable List of child content descriptors. This nullifies the contentDescriptors array so that as items are added to the list the Array is ignored until it is explicitly asked for.
Descriptor
's describe the child content of
the element that this Descriptor
describesLazily creates the mutable List of child elements. This nullifies the elementDescriptors array so that as items are added to the list the Array is ignored until it is explicitly asked for.
ElementDescriptor
's describe the child elements of
the element that this ElementDescriptor
describes