CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.run.xml
Class XmlBean.BeanInfo

java.lang.Object
  extended by com.tangosol.run.xml.XmlBean.BeanInfo
Enclosing class:
XmlBean

public static class XmlBean.BeanInfo
extends Object

A BeanInfo contains information about the XML bean and its properties. One BeanInfo will be created for each specific class of XmlBean.


Field Summary
protected static Class[] ADAPTER_INIT_PARAMS
          Parameters for finding the default adapter constructor.
protected  PropertyAdapter[] m_aAdapter
          The property adapters for the XML bean.
protected  Class m_clzBean
          The class of the specific XML bean.
protected  boolean m_fDeepClone
          Specifies whether the XML bean requires a deep clone.
protected  int m_nBeanId
          Serialization ID for the XmlBean class.
protected  String m_sName
          The XML element name for the XML bean.
protected  String m_sNmsPrefix
          Namespace prefix.
protected  String m_sNmsUri
          Namespace URI.
protected static Class[] NOPARAMS
          Parameters for finding no-parameter methods.
protected static Map s_mapClassAdapters
          Map from the class of a property type to the class of the adapter that handles the type.
protected static Map s_mapClassNames
          Map from type name / short class name to actual class instance.
protected static Map s_mapPrimitiveNames
          Map from class of an intrinsic type to its JVM signature.
 
Constructor Summary
protected XmlBean.BeanInfo(Class clzBean, XmlElement xml)
          Construct a BeanInfo.
 
Method Summary
 PropertyAdapter findAdapter(String sName)
          Find a property adapter instance for the specified property.
 PropertyAdapter[] getAdapters()
          Obtain the PropertyAdapter objects for the properties of this XML bean.
 int getBeanId()
          Get the serialization ID for the specific XML bean implementation.
 String getName()
          Determine the element name that the XML bean will use when serializing to XML.
 String getNamespacePrefix()
          Obtain the default namespace prefix for this XML bean.
 String getNamespaceUri()
          Obtain the namespace URI for this XML bean.
 Class getType()
          Get the class of the specific XML bean implementation.
protected  PropertyAdapter makeAdapter(Class clz, String sName, String sXmlName, XmlElement xml)
          Generate a property adapter instance that will work on this bean class and will adapt for a property of the specified class and of the specified name.
 boolean requiresDeepClone()
          Determine if a clone of the XmlBean should be a deep clone, which typically means that at least one property value is mutable reference type.
 Class resolveClass(String sClass)
          Resolve a Class name into a Class object.
 void setNamespacePrefix(String sPrefix)
          Set the default Namespace prefix for this XML bean.
 String toString()
          Debugging support.
 

Field Detail

m_clzBean

protected Class m_clzBean
The class of the specific XML bean.


m_sName

protected String m_sName
The XML element name for the XML bean.


m_aAdapter

protected PropertyAdapter[] m_aAdapter
The property adapters for the XML bean.


m_fDeepClone

protected boolean m_fDeepClone
Specifies whether the XML bean requires a deep clone.


m_sNmsUri

protected String m_sNmsUri
Namespace URI.


m_sNmsPrefix

protected String m_sNmsPrefix
Namespace prefix.


m_nBeanId

protected int m_nBeanId
Serialization ID for the XmlBean class.


NOPARAMS

protected static Class[] NOPARAMS
Parameters for finding no-parameter methods.


ADAPTER_INIT_PARAMS

protected static Class[] ADAPTER_INIT_PARAMS
Parameters for finding the default adapter constructor.


s_mapClassNames

protected static final Map s_mapClassNames
Map from type name / short class name to actual class instance.


s_mapClassAdapters

protected static final Map s_mapClassAdapters
Map from the class of a property type to the class of the adapter that handles the type.


s_mapPrimitiveNames

protected static final Map s_mapPrimitiveNames
Map from class of an intrinsic type to its JVM signature.

Constructor Detail

XmlBean.BeanInfo

protected XmlBean.BeanInfo(Class clzBean,
                           XmlElement xml)
Construct a BeanInfo.

Parameters:
clzBean - the class of the bean
xml - the xml descriptor
Method Detail

getType

public Class getType()
Get the class of the specific XML bean implementation.

Returns:
the type of the XML bean

getBeanId

public int getBeanId()
Get the serialization ID for the specific XML bean implementation.

Returns:
the XmlBean ID used by ExternalizableHelper, or -1 if this XmlBean does not have an ID assigned or if the ID optimization is not being used

getName

public String getName()
Determine the element name that the XML bean will use when serializing to XML.

Returns:
the local XmlElement name for the bean

getNamespaceUri

public String getNamespaceUri()
Obtain the namespace URI for this XML bean.

Returns:
the URI that qualifies the default Namespace for this bean

getNamespacePrefix

public String getNamespacePrefix()
Obtain the default namespace prefix for this XML bean.

Returns:
the default Namespace prefix for this bean

setNamespacePrefix

public void setNamespacePrefix(String sPrefix)
Set the default Namespace prefix for this XML bean.

Parameters:
sPrefix - the default namespace prefix

getAdapters

public PropertyAdapter[] getAdapters()
Obtain the PropertyAdapter objects for the properties of this XML bean.

Returns:
the property adapters for this bean

requiresDeepClone

public boolean requiresDeepClone()
Determine if a clone of the XmlBean should be a deep clone, which typically means that at least one property value is mutable reference type.

Returns:
true if any of the property values must be "deep" cloned when the XmlBean is cloned

makeAdapter

protected PropertyAdapter makeAdapter(Class clz,
                                      String sName,
                                      String sXmlName,
                                      XmlElement xml)
Generate a property adapter instance that will work on this bean class and will adapt for a property of the specified class and of the specified name.

Parameters:
clz - the class of the property
sName - the property name
sXmlName - the corresponding element name
xml - additional XML information
Returns:
an adapter that will handle the specified property

findAdapter

public PropertyAdapter findAdapter(String sName)
Find a property adapter instance for the specified property.

Parameters:
sName - the property name
Returns:
an adapter that handles the specified property; null if none could be found

resolveClass

public Class resolveClass(String sClass)
Resolve a Class name into a Class object.

Parameters:
sClass - the Class name
Returns:
the Class object

toString

public String toString()
Debugging support.

Returns:
a String description of this Info object

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation