Package com.tangosol.run.xml
Class XmlBean.BeanInfo
java.lang.Object
com.tangosol.run.xml.XmlBean.BeanInfo
- Enclosing class:
XmlBean
A BeanInfo contains information about the XML bean and its properties.
One BeanInfo will be created for each specific class of XmlBean.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static Class[]
Parameters for finding the default adapter constructor.protected PropertyAdapter[]
The property adapters for the XML bean.protected Class
The class of the specific XML bean.protected boolean
Specifies whether the XML bean requires a deep clone.protected int
Serialization ID for the XmlBean class.protected String
The XML element name for the XML bean.protected String
Namespace prefix.protected String
Namespace URI.protected static final Class[]
Parameters for finding no-parameter methods.protected static final Map
Map from the class of a property type to the class of the adapter that handles the type.protected static final Map
Map from type name / short class name to actual class instance.protected static final Map
Map from class of an intrinsic type to its JVM signature. -
Constructor Summary
ModifierConstructorDescriptionprotected
BeanInfo
(Class clzBean, XmlElement xml) Construct a BeanInfo. -
Method Summary
Modifier and TypeMethodDescriptionfindAdapter
(String sName) Find a property adapter instance for the specified property.Obtain the PropertyAdapter objects for the properties of this XML bean.int
Get the serialization ID for the specific XML bean implementation.getName()
Determine the element name that the XML bean will use when serializing to XML.Obtain the default namespace prefix for this XML bean.Obtain the namespace URI for this XML bean.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
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.resolveClass
(String sClass) Resolve a Class name into a Class object.void
setNamespacePrefix
(String sPrefix) Set the default Namespace prefix for this XML bean.toString()
Debugging support.
-
Field Details
-
m_clzBean
The class of the specific XML bean. -
m_sName
The XML element name for the XML bean. -
m_aAdapter
The property adapters for the XML bean. -
m_fDeepClone
protected boolean m_fDeepCloneSpecifies whether the XML bean requires a deep clone. -
m_sNmsUri
Namespace URI. -
m_sNmsPrefix
Namespace prefix. -
m_nBeanId
protected int m_nBeanIdSerialization ID for the XmlBean class. -
NOPARAMS
Parameters for finding no-parameter methods. -
ADAPTER_INIT_PARAMS
Parameters for finding the default adapter constructor. -
s_mapClassNames
Map from type name / short class name to actual class instance. -
s_mapClassAdapters
Map from the class of a property type to the class of the adapter that handles the type. -
s_mapPrimitiveNames
Map from class of an intrinsic type to its JVM signature.
-
-
Constructor Details
-
BeanInfo
Construct a BeanInfo.- Parameters:
clzBean
- the class of the beanxml
- the xml descriptor
-
-
Method Details
-
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
Determine the element name that the XML bean will use when serializing to XML.- Returns:
- the local XmlElement name for the bean
-
getNamespaceUri
Obtain the namespace URI for this XML bean.- Returns:
- the URI that qualifies the default Namespace for this bean
-
getNamespacePrefix
Obtain the default namespace prefix for this XML bean.- Returns:
- the default Namespace prefix for this bean
-
setNamespacePrefix
Set the default Namespace prefix for this XML bean.- Parameters:
sPrefix
- the default namespace prefix
-
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
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 propertysName
- the property namesXmlName
- the corresponding element namexml
- additional XML information- Returns:
- an adapter that will handle the specified property
-
findAdapter
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
Resolve a Class name into a Class object.- Parameters:
sClass
- the Class name- Returns:
- the Class object
-
toString
Debugging support.
-