org.exolab.castor.types
Class BaseDescriptor
java.lang.Object
org.exolab.castor.types.BaseDescriptor
- ClassDescriptor, XMLClassDescriptor
public class BaseDescriptor
extends java.lang.Object
The Base Descriptor class, this class is extended
by the descriptors for the custom Castor schema types.
$Revision: 7297 $ $Date: 2004-12-16 22:49:25 -0700 (Thu, 16 Dec 2004) $
noXMLFields
protected static final XMLFieldDescriptor[] noXMLFields
Used for returning no attribute and no element fields
BaseDescriptor
protected BaseDescriptor(String xmlName,
Class type)
canAccept
public boolean canAccept(String name,
String namespace,
Object object)
Returns true if the given object represented by this XMLClassDescriptor
can accept a member whose name is given. An XMLClassDescriptor can accept
a field if it contains a descriptor that matches the given name and if
the given object can hold this field (i.e a value is not already set for
this field).
This is mainly used for container object (that can contains other
object), in this particular case the implementation will return null.
- canAccept in interface XMLClassDescriptor
name
- the xml name of the field to checknamespace
- the namespace uriobject
- the object represented by this XMLCLassDescriptor
- true if the given object represented by this XMLClassDescriptor
can accept a member whose name is given.
getAccessMode
public AccessMode getAccessMode()
Returns the access mode specified for this class.
getAttributeDescriptors
public XMLFieldDescriptor[] getAttributeDescriptors()
Returns the set of XMLFieldDescriptors for all members that should be
marshalled as XML attributes.
- getAttributeDescriptors in interface XMLClassDescriptor
- an array of XMLFieldDescriptors for all members that should be
marshalled as XML attributes.
getContentDescriptor
public XMLFieldDescriptor getContentDescriptor()
Returns the XMLFieldDescriptor for the member that should be marshalled
as text content.
- getContentDescriptor in interface XMLClassDescriptor
- the XMLFieldDescriptor for the member that should be marshalled
as text content.
getElementDescriptors
public XMLFieldDescriptor[] getElementDescriptors()
Returns the set of XMLFieldDescriptors for all members that should be
marshalled as XML elements.
- getElementDescriptors in interface XMLClassDescriptor
- an array of XMLFieldDescriptors for all members that should be
marshalled as XML elements.
getFieldDescriptor
public XMLFieldDescriptor getFieldDescriptor(String name,
String namespace,
NodeType nodeType)
Returns the XML field descriptor matching the given xml name and
nodeType. If NodeType is null, then either an AttributeDescriptor, or
ElementDescriptor may be returned. Null is returned if no matching
descriptor is available.
- getFieldDescriptor in interface XMLClassDescriptor
name
- The xml name to match against.namespace
- The namespace uri.nodeType
- The NodeType to match against, or null if the node type is not
known.
- The matching descriptor, or null if no matching descriptor is
available.
getJavaClass
public Class getJavaClass()
Returns the Java class represented by this descriptor.
- getJavaClass in interface ClassDescriptor
getValidator
public TypeValidator getValidator()
Returns a specific validator for the class described by this
ClassDescriptor. A null value may be returned if no specific validator
exists.
- getValidator in interface XMLClassDescriptor
- the type validator for the class described by this
ClassDescriptor.
toString
public String toString()
Returns the String representation of this XMLClassDescriptor.
- the String representation of this XMLClassDescriptor.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com