public class TypeDesc extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
static Class[] |
noClasses |
static Object[] |
noObjects |
Constructor and Description |
---|
TypeDesc(Class javaClass)
Creates a new
TypeDesc instance. |
TypeDesc(Class javaClass,
boolean canSearchParents)
Creates a new
TypeDesc instance. |
Modifier and Type | Method and Description |
---|---|
void |
addFieldDesc(FieldDesc field)
Add a new FieldDesc, keeping the convenience fields in sync.
|
BeanPropertyDescriptor |
getAnyContentDescriptor() |
BeanPropertyDescriptor |
getAnyDesc() |
QName |
getAttributeNameForField(String fieldName)
Get the QName associated with this field, but only if it's
marked as an attribute.
|
QName |
getElementNameForField(String fieldName)
Get the QName associated with this field, but only if it's
marked as an element.
|
FieldDesc |
getFieldByName(String name)
Get a FieldDesc by field name.
|
String |
getFieldNameForAttribute(QName qname)
Get the field name associated with this QName, but only if it's
marked as an attribute.
|
String |
getFieldNameForElement(QName qname,
boolean ignoreNS)
Get the field name associated with this QName, but only if it's
marked as an element.
|
FieldDesc[] |
getFields()
Obtain the current array of FieldDescs
|
FieldDesc[] |
getFields(boolean searchParents) |
Map |
getPropertyDescriptorMap()
Get/Cache the property descriptor map
|
BeanPropertyDescriptor[] |
getPropertyDescriptors()
Get/Cache the property descriptors
|
static TypeDesc |
getTypeDescForClass(Class cls)
Static function for centralizing access to type metadata for a
given class.
|
QName |
getXmlType() |
boolean |
hasAttributes()
Do we have any FieldDescs marked as attributes?
|
static void |
registerTypeDescForClass(Class cls,
TypeDesc td)
Static function to explicitly register a type description for
a given class.
|
void |
setFields(FieldDesc[] newFields)
Replace the array of FieldDescs, making sure we keep our convenience
caches in sync.
|
void |
setXmlType(QName xmlType) |
public static final Class[] noClasses
public static final Object[] noObjects
protected static org.apache.commons.logging.Log log
public TypeDesc(Class javaClass)
TypeDesc
instance. The type desc can search
the metadata of its type'sparent classes.javaClass
- a Class
valuepublic TypeDesc(Class javaClass, boolean canSearchParents)
TypeDesc
instance.javaClass
- a Class
valuecanSearchParents
- whether the type desc can search the metadata of
its type's parent classes.public static void registerTypeDescForClass(Class cls, TypeDesc td)
cls
- the Class we're registering metadata abouttd
- the TypeDesc containing the metadatapublic static TypeDesc getTypeDescForClass(Class cls)
public BeanPropertyDescriptor getAnyDesc()
public FieldDesc[] getFields()
public FieldDesc[] getFields(boolean searchParents)
public void setFields(FieldDesc[] newFields)
public void addFieldDesc(FieldDesc field)
public QName getElementNameForField(String fieldName)
public QName getAttributeNameForField(String fieldName)
public String getFieldNameForElement(QName qname, boolean ignoreNS)
public String getFieldNameForAttribute(QName qname)
public boolean hasAttributes()
public QName getXmlType()
public void setXmlType(QName xmlType)
public BeanPropertyDescriptor[] getPropertyDescriptors()
public BeanPropertyDescriptor getAnyContentDescriptor()
public Map getPropertyDescriptorMap()
Copyright © The Apache Software Foundation. All Rights Reserved.