org.apache.axis.description
Class TypeDesc

java.lang.Object
  |
  +--org.apache.axis.description.TypeDesc

public class TypeDesc
extends java.lang.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 java.lang.Class[] noClasses
           
 
Constructor Summary
TypeDesc()
           
 
Method Summary
 void addFieldDesc(FieldDesc field)
          Add a new FieldDesc, keeping the convenience fields in sync.
 QName getAttributeNameForField(java.lang.String fieldName)
          Get the QName associated with this field, but only if it's marked as an attribute.
 QName getElementNameForField(java.lang.String fieldName)
          Get the QName associated with this field, but only if it's marked as an element.
 FieldDesc getFieldByName(java.lang.String name)
          Get a FieldDesc by field name.
 java.lang.String getFieldNameForAttribute(QName qname)
          Get the field name associated with this QName, but only if it's marked as an attribute.
 java.lang.String getFieldNameForElement(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
static TypeDesc getTypeDescForClass(java.lang.Class cls)
          Static function for centralizing access to type metadata for a given class.
 boolean hasAttributes()
          Do we have any FieldDescs marked as attributes?
 void setFields(FieldDesc[] newFields)
          Replace the array of FieldDescs, making sure we keep our convenience caches in sync.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noClasses

public static java.lang.Class[] noClasses
Constructor Detail

TypeDesc

public TypeDesc()
Method Detail

getTypeDescForClass

public static TypeDesc getTypeDescForClass(java.lang.Class cls)
Static function for centralizing access to type metadata for a given class. Right now this just checks for a static getTypeDesc() method on the class, but we will eventually 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)

getFields

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

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 QName getElementNameForField(java.lang.String fieldName)
Get the QName associated with this field, but only if it's marked as an element.

getAttributeNameForField

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

getFieldNameForElement

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

getFieldNameForAttribute

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

getFieldByName

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

hasAttributes

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


Copyright © 2001 Apache XML Project. All Rights Reserved.