|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.betwixt.XMLBeanInfo
XMLBeanInfo
represents the XML metadata information
used to map a Java Bean cleanly to XML. This provides a default
introspection mechansim, rather like BeanInfo
which can be customized through some mechansim, either via Java code
or XSLT for example.
ID
and IDREF
Attribute NamesThese special attributes are defined in the xml specification. They are used by Betwixt to write bean graphs with cyclic references. In most cases, these will take the values 'id' and 'idref' respectively but these names can be varied in the DTD. Therefore, these names are specified by this class but default to the usual values.
Field Summary | |
---|---|
private java.lang.Class |
beanClass
the beans class that this XML info refers to |
private boolean |
cachedIDAttribute
Have we already cached the idAttributeDescriptor ? |
private ElementDescriptor |
elementDescriptor
Descriptor for main element |
private AttributeDescriptor |
idAttributeDescriptor
Cached ID attribute descriptor |
private java.lang.String |
idAttributeName
ID attribute name |
private java.lang.String |
idrefAttributeName
IDREF attribute name |
Constructor Summary | |
---|---|
XMLBeanInfo(java.lang.Class beanClass)
Base constructor |
Method Summary | |
---|---|
private AttributeDescriptor |
findIDAttribute()
ID attribute search implementation |
java.lang.Class |
getBeanClass()
Gets the beans class that this XML info refers to |
ElementDescriptor |
getElementDescriptor()
Gets descriptor for bean represention |
AttributeDescriptor |
getIDAttribute()
Search attributes for one matching ID attribute name |
java.lang.String |
getIDAttributeName()
Get name of ID attribute. |
java.lang.String |
getIDREFAttributeName()
Get IDREF attribute name
This is used (for example) to deal with cyclic references. |
void |
setBeanClass(java.lang.Class beanClass)
Sets the beans class that this XML info refers to |
void |
setElementDescriptor(ElementDescriptor elementDescriptor)
Sets descriptor for bean represention |
void |
setIDAttributeName(java.lang.String idAttributeName)
Set name of ID attribute
This is used to write (for example) automatic ID
attribute values. |
void |
setIDREFAttributeName(java.lang.String idrefAttributeName)
Set IDREF attribute name
This is used (for example) to deal with cyclic references. |
java.lang.String |
toString()
Gets log-friendly string representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private ElementDescriptor elementDescriptor
private java.lang.Class beanClass
private java.lang.String idAttributeName
ID
attribute name
private java.lang.String idrefAttributeName
IDREF
attribute name
private boolean cachedIDAttribute
idAttributeDescriptor
?
private AttributeDescriptor idAttributeDescriptor
ID
attribute descriptor
Constructor Detail |
public XMLBeanInfo(java.lang.Class beanClass)
beanClass
- for this ClassMethod Detail |
public ElementDescriptor getElementDescriptor()
public void setElementDescriptor(ElementDescriptor elementDescriptor)
elementDescriptor
- descriptor for beanpublic java.lang.Class getBeanClass()
public void setBeanClass(java.lang.Class beanClass)
beanClass
- the class that this refers topublic AttributeDescriptor getIDAttribute()
ID
attribute name
private AttributeDescriptor findIDAttribute()
ID
attributepublic java.lang.String getIDAttributeName()
Get name of ID
attribute.
This is used to write (for example) automatic ID
attribute values.
The default name is 'id'.
ID
attributepublic void setIDAttributeName(java.lang.String idAttributeName)
ID
attribute
This is used to write (for example) automatic ID
attribute values.
The default name is 'id'.
idAttributeName
- the attribute name for the special ID
attributepublic java.lang.String getIDREFAttributeName()
Get IDREF
attribute name
This is used (for example) to deal with cyclic references.
The default name is 'idref'.
IDREF
attributepublic void setIDREFAttributeName(java.lang.String idrefAttributeName)
IDREF
attribute name
This is used (for example) to deal with cyclic references.
The default name is 'idref'.
idrefAttributeName
- the attribute name for the special IDREF
attributepublic java.lang.String toString()
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |