站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档

TypeDesc (JAXRPC API) - JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档


org.apache.axis.description
Class TypeDesc

java.lang.Object
  extended byorg.apache.axis.description.TypeDesc

public class TypeDesc
extends Object

A TypeDesc represents a Java<->XML data binding. It is essentially a collection of FieldDescs describing how to map each field in a Java class to XML.

Author:
Glen Daniels (gdaniels@apache.org)

Field Summary
static Class[] noClasses
           
static Object[] noObjects
           
 
Constructor Summary
TypeDesc(Class javaClass)
           
 
Method Summary
 void addFieldDesc(FieldDesc field)
          Add a new FieldDesc, keeping the convenience fields in sync.
 BeanPropertyDescriptor getAnyContentDescriptor()
           
 BeanPropertyDescriptor getAnyDesc()
           
 javax.xml.namespace.QName getAttributeNameForField(String fieldName)
          Get the QName associated with this field, but only if it's marked as an attribute.
 javax.xml.namespace.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(javax.xml.namespace.QName qname)
          Get the field name associated with this QName, but only if it's marked as an attribute.
 String getFieldNameForElement(javax.xml.namespace.QName qname)
          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.
 javax.xml.namespace.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 setPropertyDescriptors(BeanPropertyDescriptor[] propertyDescriptors)
          Set the property descriptors for this type, for example in a different order
 void setXmlType(javax.xml.namespace.QName xmlType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noClasses

public static final Class[] noClasses

noObjects

public static final Object[] noObjects
Constructor Detail

TypeDesc

public TypeDesc(Class javaClass)
Method Detail

registerTypeDescForClass

public static void registerTypeDescForClass(Class cls,
                                            TypeDesc td)
Static function to explicitly register a type description for a given class.

Parameters:
cls - the Class we're registering metadata about
td - the TypeDesc containing the metadata

getTypeDescForClass

public static TypeDesc getTypeDescForClass(Class cls)
Static function for centralizing access to type metadata for a given class.

This checks for a static getTypeDesc() method on the class or _Helper class. Eventually we may extend this to provide for external metadata config (via files sitting in the classpath, etc).

(Could introduce a cache here for speed as an optimization)


getAnyDesc

public BeanPropertyDescriptor getAnyDesc()

getFields

public FieldDesc[] getFields()
Obtain the current array of FieldDescs


getFields

public FieldDesc[] getFields(boolean searchParents)

setFields

public void setFields(FieldDesc[] newFields)
Replace the array of FieldDescs, making sure we keep our convenience caches in sync.


addFieldDesc

public void addFieldDesc(FieldDesc field)
Add a new FieldDesc, keeping the convenience fields in sync.


getElementNameForField

public javax.xml.namespace.QName getElementNameForField(String fieldName)
Get the QName associated with this field, but only if it's marked as an element.


getAttributeNameForField

public javax.xml.namespace.QName getAttributeNameForField(String fieldName)
Get the QName associated with this field, but only if it's marked as an attribute.


getFieldNameForElement

public String getFieldNameForElement(javax.xml.namespace.QName qname)
Get the field name associated with this QName, but only if it's marked as an element.


getFieldNameForAttribute

public String getFieldNameForAttribute(javax.xml.namespace.QName qname)
Get the field name associated with this QName, but only if it's marked as an attribute.


getFieldByName

public FieldDesc getFieldByName(String name)
Get a FieldDesc by field name.


hasAttributes

public boolean hasAttributes()
Do we have any FieldDescs marked as attributes?


getXmlType

public javax.xml.namespace.QName getXmlType()

setXmlType

public void setXmlType(javax.xml.namespace.QName xmlType)

getPropertyDescriptors

public BeanPropertyDescriptor[] getPropertyDescriptors()
Get/Cache the property descriptors

Returns:
PropertyDescriptor

setPropertyDescriptors

public void setPropertyDescriptors(BeanPropertyDescriptor[] propertyDescriptors)
Set the property descriptors for this type, for example in a different order


getAnyContentDescriptor

public BeanPropertyDescriptor getAnyContentDescriptor()

getPropertyDescriptorMap

public Map getPropertyDescriptorMap()
Get/Cache the property descriptor map

Returns:
Map with key=propertyName, value=descriptor


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.