org.exolab.castor.xml.util
public class XMLClassDescriptorImpl extends Validator implements XMLClassDescriptor
Version: $Revision: 1.9 $ $Date: 2005/03/01 06:20:16 $
Constructor Summary | |
---|---|
XMLClassDescriptorImpl(Class type)
Creates an XMLClassDescriptor class used by the Marshalling Framework.
| |
XMLClassDescriptorImpl(Class type, String xmlName)
Creates an XMLClassDescriptor class used by the Marshalling Framework.
| |
protected | XMLClassDescriptorImpl()
Protected constructor used by this class, and subclasses only |
Method Summary | |
---|---|
void | addFieldDescriptor(XMLFieldDescriptor descriptor)
Adds the given XMLFieldDescriptor to the list of descriptors. |
boolean | canAccept(String name, String namespace, Object object) |
boolean | contains(XMLFieldDescriptor descriptor)
Returns true if the given XMLFieldDescriptor is contained
within this XMLClassDescriptor.
|
AccessMode | getAccessMode()
Returns the access mode specified for this class.
|
XMLFieldDescriptor[] | getAttributeDescriptors()
Returns the set of XMLFieldDescriptors for all members
that should be marshalled as XML attributes.
|
XMLFieldDescriptor | getContentDescriptor()
Returns the XMLFieldDescriptor for the member
that should be marshalled as text content.
|
XMLFieldDescriptor[] | getElementDescriptors()
Returns the set of XMLFieldDescriptors for all members
that should be marshalled as XML elements.
|
ClassDescriptor | getExtends()
Returns the class descriptor of the class extended by this class.
|
XMLFieldDescriptor | getFieldDescriptor(String name, String namespace, NodeType nodeType)
Returns the XML field descriptor matching the given xml name and
nodeType. |
FieldDescriptor[] | getFields()
Returns a list of fields represented by this descriptor.
|
FieldDescriptor | getIdentity()
Returns the identity field, null if this class has no identity.
|
Class | getJavaClass()
Returns the Java class represented by this descriptor.
|
String | getNameSpacePrefix() |
String | getNameSpaceURI() |
TypeValidator | getValidator()
Returns a specific validator for the class described by
this ClassDescriptor. |
String | getXMLName()
Returns the XML Name for the Class being described.
|
boolean | hasContainerFields()
Returns true if this XMLClassDescriptorImpl has any fields which are
container objects. |
static boolean | isDefaultPrimitiveValue(Object value)
Checks to see if the given Object is a java primitive
(does not check for primitive wrappers) and has a
value that is equal to the default value for that
primitive. |
static boolean | isPrimitive(Class type)
Returns true if the given class should be treated as a primitive
type. |
boolean | removeFieldDescriptor(XMLFieldDescriptor descriptor)
Removes the given XMLFieldDescriptor from the list of descriptors.
|
void | setCompositorAsAll()
Sets the compositor for the fields of the described
class to be ALL. |
void | setCompositorAsChoice()
Sets the compositor for the fields of the described
class to be CHOICE. |
void | setCompositorAsSequence()
Sets the compositor for the fields of the described
class to be a Sequence. |
void | setExtends(XMLClassDescriptor classDesc)
Sets the XMLClassDescriptor that this descriptor inherits from |
protected void | setExtendsWithoutFlatten(XMLClassDescriptor classDesc) |
void | setIdentity(XMLFieldDescriptor fieldDesc)
Sets the Identity FieldDescriptor, if the FieldDescriptor is
not already a contained in this ClassDescriptor, it will be
added |
protected void | setIntrospected(boolean introspected)
Sets a flag to indicate whether or not this XMLClassDescriptorImpl
was created via introspection
|
protected void | setJavaClass(Class type)
Sets the Class type being described by this descriptor.
|
void | setNameSpacePrefix(String nsPrefix)
Sets the namespace prefix used when marshalling as XML.
|
void | setNameSpaceURI(String nsURI)
Sets the namespace URI used when marshalling and unmarshalling as XML.
|
void | setXMLName(String xmlName)
Sets the XML name for the Class described by this XMLClassDescriptor
|
void | sortDescriptors()
This method is used to keep the set of descriptors in the proper
sorted lists. |
String | toString()
Returns the String representation of this XMLClassDescriptor
|
protected String | toXMLName(String className) |
void | validate(Object object)
Validates the given Object
|
void | validate(Object object, ValidationContext context)
Validates the given object |
Parameters: type the Class type with which this ClassDescriptor describes.
Parameters: type the Class type with which this ClassDescriptor describes.
Parameters: descriptor the XMLFieldDescriptor to add
Returns: true if the XMLFieldDescriptor is part of this XMLClassDescriptor, otherwise false.
Returns: The access mode
Returns: an array of XMLFieldDescriptors for all members that should be marshalled as XML attributes.
Returns: the XMLFieldDescriptor for the member that should be marshalled as text content.
Returns: an array of XMLFieldDescriptors for all members that should be marshalled as XML elements.
Returns: The extended class descriptor
Parameters: name the xml name to match against nodeType, the NodeType to match against, or null if the node type is not known.
Returns: the matching descriptor, or null if no matching descriptor is available.
Returns: A list of fields
Returns: The identity field
Returns: The Java class
Returns: the namespace prefix to use when marshalling as XML.
Returns: the namespace URI used when marshalling and unmarshalling as XML.
Returns: the type validator for the class described by this ClassDescriptor.
Returns: the XML name.
Returns: true if any of the fields are container fields, otherwise false.
Returns: true if the value is a java primitive with a default value
Returns: true if the given class should be treated as a primitive type
Parameters: descriptor the XMLFieldDescriptor to remove
UNKNOWN: true if the descriptor was removed.
Parameters: classDesc the XMLClassDescriptor that this descriptor extends
Parameters: introspected a boolean, when true indicated that this XMLClassDescriptor was created via introspection
UNKNOWN: the Class type being described
Parameters: nsPrefix the namespace prefix used when marshalling the "described" object
Parameters: nsURI the namespace URI used when marshalling and unmarshalling the "described" Object.
Parameters: xmlName the XML name for the Class described by this XMLClassDescriptor
Returns: the String representation of this XMLClassDescriptor
Parameters: object the Object to validate
Parameters: object the Object to validate context the ValidationContext