|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
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.
| Constructor Summary | |
ElementDescriptor()
Constructs an ElementDescriptor that refers to a primitive type. |
|
ElementDescriptor(boolean primitiveType)
Deprecated. 0.6 PrimitiveType property has been removed |
|
ElementDescriptor(java.lang.String localName)
Creates a ElementDescriptor with no namespace URI or prefix. |
|
ElementDescriptor(java.lang.String localName,
java.lang.String qualifiedName,
java.lang.String uri)
Creates a ElementDescriptor with namespace URI and qualified name |
|
| Method Summary | |
void |
addAttributeDescriptor(AttributeDescriptor descriptor)
Adds an attribute to the element this ElementDescriptor describes |
void |
addContentDescriptor(Descriptor descriptor)
Adds a descriptor for child content. |
void |
addElementDescriptor(ElementDescriptor descriptor)
Adds a descriptor for a child element. |
ElementDescriptor |
findParent(ElementDescriptor elementDescriptor)
|
AttributeDescriptor[] |
getAttributeDescriptors()
Returns the attribute descriptors for this element |
protected java.util.List |
getAttributeList()
Lazily creates the mutable List. |
Descriptor[] |
getContentDescriptors()
Returns descriptors for the child content of the element this describes. |
protected java.util.List |
getContentList()
Lazily creates the mutable List of child content descriptors. |
Expression |
getContextExpression()
Returns the expression used to evaluate the new context of this element. |
ElementDescriptor |
getElementDescriptor(java.lang.String name)
Gets a child ElementDescriptor matching the given name if one exists. |
ElementDescriptor[] |
getElementDescriptors()
Returns descriptors for the child elements of the element this describes. |
protected java.util.List |
getElementList()
Lazily creates the mutable List of child elements. |
java.lang.Class |
getImplementationClass()
Gets the class which should be used for instantiation. |
TextDescriptor |
getPrimaryBodyTextDescriptor()
Gets the primary descriptor for body text of this element. |
boolean |
hasAttributes()
Returns true if this element has AttributeDescriptors |
boolean |
hasChildren()
Returns true if this element has child ElementDescriptors |
boolean |
hasContent()
Returns true if this element has child content. |
boolean |
isCollective()
TODO is this implementation correct? maybe this method is unnecessary |
boolean |
isHollow()
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. |
boolean |
isPrimitiveType()
Deprecated. 0.6 moved to a declarative style of descriptors where the alrogithmic should be done during introspection |
boolean |
isSimple()
Is this a simple element? A simple element is one without child elements or attributes. |
boolean |
isWrapCollectionsInElement()
Deprecated. 0.6 moved to a declarative style of descriptors where the alrogithmic should be done during introspection |
void |
setAttributeDescriptors(AttributeDescriptor[] attributeDescriptors)
Sets the AttributesDescriptors for this element. |
void |
setContentDescriptors(Descriptor[] contentDescriptors)
Sets the descriptors for the child content of the element this describes. |
void |
setContextExpression(Expression contextExpression)
Sets the expression used to evaluate the new context of this element |
void |
setElementDescriptors(ElementDescriptor[] elementDescriptors)
Sets the descriptors for the child element of the element this describes. |
void |
setHollow(boolean isHollow)
Sets whether this descriptor is hollow. |
void |
setImplementationClass(java.lang.Class implementationClass)
Sets the class which should be used for instantiation. |
void |
setPrimitiveType(boolean primitiveType)
Deprecated. 0.6 moved to a declarative style of descriptors where the alrogithmic should be done during introspection |
void |
setWrapCollectionsInElement(boolean wrapCollectionsInElement)
Deprecated. 0.6 moved to a declarative style of descriptors where the alrogithmic should be done during introspection |
java.lang.String |
toString()
Returns something useful for logging. |
| Methods inherited from class org.apache.commons.betwixt.NodeDescriptor |
getLocalName, getQualifiedName, getURI, setLocalName, setQualifiedName, setURI |
| Methods inherited from class org.apache.commons.betwixt.Descriptor |
getOptions, getPropertyName, getPropertyType, getSingularPropertyType, getTextExpression, getUpdater, setOptions, setPropertyName, setPropertyType, setSingularPropertyType, setTextExpression, setUpdater |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ElementDescriptor()
ElementDescriptor that refers to a primitive type.
public ElementDescriptor(boolean primitiveType)
primitiveType - if true, this element refers to a primitive typepublic ElementDescriptor(java.lang.String localName)
localName - the (xml) local name of this node.
This will be used to set both qualified and local name for this name.
public ElementDescriptor(java.lang.String localName,
java.lang.String qualifiedName,
java.lang.String uri)
ElementDescriptor with namespace URI and qualified name
localName - the (xml) local name of this nodequalifiedName - the (xml) qualified name of this nodeuri - the (xml) namespace prefix of this node| Method Detail |
public boolean hasChildren()
ElementDescriptors
getElementDescriptors()public boolean hasAttributes()
AttributeDescriptors
getAttributeDescriptors()public boolean hasContent()
getContentDescriptors()public boolean isSimple()
SimpleType elementpublic void setWrapCollectionsInElement(boolean wrapCollectionsInElement)
Collection bean properties should wrap items in a parent element.
In other words, should the mapping for bean properties which are Collections
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 elementpublic boolean isWrapCollectionsInElement()
Collections
enclosed the item elements within a parent element.
Normally only used when this describes a collection bean property.
public void addAttributeDescriptor(AttributeDescriptor descriptor)
ElementDescriptor describes
descriptor - the AttributeDescriptor that will be added to the
attributes associated with element this ElementDescriptor describespublic AttributeDescriptor[] getAttributeDescriptors()
ElementDescriptor describespublic void setAttributeDescriptors(AttributeDescriptor[] attributeDescriptors)
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 ElementDescriptorpublic void addElementDescriptor(ElementDescriptor descriptor)
descriptor - the ElementDescriptor describing the child element to addpublic ElementDescriptor[] getElementDescriptors()
ElementDescriptor describing the child elements
of the element that this ElementDescriptor describespublic ElementDescriptor getElementDescriptor(java.lang.String name)
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 nullpublic void setElementDescriptors(ElementDescriptor[] elementDescriptors)
elementDescriptors - the ElementDescriptors of the element
that this describespublic void addContentDescriptor(Descriptor descriptor)
descriptor - the Descriptor describing the child content to addpublic Descriptor[] getContentDescriptors()
Descriptor describing the child elements
of the element that this ElementDescriptor describespublic TextDescriptor getPrimaryBodyTextDescriptor()
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.
public void setContentDescriptors(Descriptor[] contentDescriptors)
contentDescriptors - the Descriptors of the element
that this describespublic Expression getContextExpression()
public void setContextExpression(Expression contextExpression)
contextExpression - the expression used to evaluate the new context of this elementpublic boolean isPrimitiveType()
public void setPrimitiveType(boolean primitiveType)
primitiveType - true if this element refers to a primitive typeprotected java.util.List getAttributeList()
AttributeDescriptors's describing the attributes
of the element that this ElementDescriptor describesprotected java.util.List getElementList()
ElementDescriptor's describe the child elements of
the element that this ElementDescriptor describesprotected java.util.List getContentList()
Descriptor's describe the child content of
the element that this Descriptor describespublic java.lang.Class getImplementationClass()
public void setImplementationClass(java.lang.Class implementationClass)
implementationClass - the class which should be used for instantiation
or null to use the mapped typepublic boolean isCollective()
public ElementDescriptor findParent(ElementDescriptor elementDescriptor)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isHollow()
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
public void setHollow(boolean isHollow)
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
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||