org.apache.commons.betwixt
Class XMLBeanInfo

java.lang.Object
  extended by org.apache.commons.betwixt.XMLBeanInfo

public class XMLBeanInfo
extends java.lang.Object

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 Names

These 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.

Version:
$Revision: 438373 $
Author:
James Strachan

Constructor Summary
XMLBeanInfo(java.lang.Class beanClass)
          Base constructor
 
Method Summary
 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
 

Constructor Detail

XMLBeanInfo

public XMLBeanInfo(java.lang.Class beanClass)
Base constructor

Parameters:
beanClass - for this Class
Method Detail

getElementDescriptor

public ElementDescriptor getElementDescriptor()
Gets descriptor for bean represention

Returns:
ElementDescriptor describing root element

setElementDescriptor

public void setElementDescriptor(ElementDescriptor elementDescriptor)
Sets descriptor for bean represention

Parameters:
elementDescriptor - descriptor for bean

getBeanClass

public java.lang.Class getBeanClass()
Gets the beans class that this XML info refers to

Returns:
the beans class that this XML info refers to

setBeanClass

public void setBeanClass(java.lang.Class beanClass)
Sets the beans class that this XML info refers to

Parameters:
beanClass - the class that this refers to

getIDAttribute

public AttributeDescriptor getIDAttribute()
Search attributes for one matching ID attribute name

Returns:
the xml ID attribute

getIDAttributeName

public 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'.

Returns:
name for the special ID attribute

setIDAttributeName

public void setIDAttributeName(java.lang.String idAttributeName)
Set name of ID attribute This is used to write (for example) automatic ID attribute values.

The default name is 'id'.

Parameters:
idAttributeName - the attribute name for the special ID attribute

getIDREFAttributeName

public java.lang.String getIDREFAttributeName()

Get IDREF attribute name This is used (for example) to deal with cyclic references.

The default name is 'idref'.

Returns:
name for the special IDREF attribute

setIDREFAttributeName

public void setIDREFAttributeName(java.lang.String idrefAttributeName)
Set IDREF attribute name This is used (for example) to deal with cyclic references.

The default name is 'idref'.

Parameters:
idrefAttributeName - the attribute name for the special IDREF attribute

toString

public java.lang.String toString()
Gets log-friendly string representation.

Overrides:
toString in class java.lang.Object
Returns:
something useful for logging


Copyright 2002-2008 The Apache Software Foundation. All Rights Reserved.