org.exolab.castor.xml

Interface XMLClassDescriptor

All Superinterfaces:
ClassDescriptor
Known Implementing Classes:
AccessTypeDescriptor, BaseDescriptor, BindingDescriptor, BindingTypeDescriptor, BindXmlAutoNamingTypeDescriptor, BindXmlDescriptor, BindXmlNodeTypeDescriptor, CacheTypeMappingDescriptor, CenturyDescriptor, ClassMappingDescriptor, ClassTypeDescriptor, CollectionTypeDescriptor, ComponentBindingTypeChoiceDescriptor, ComponentBindingTypeDescriptor, ContainerDescriptor, DatabaseDescriptor, DataSourceDescriptor, DateClassDescriptor, DateDescriptor, DirtyTypeDescriptor, DriverDescriptor, DurationDescriptor, FieldMappingDescriptor, FieldTypeCollectionTypeDescriptor, FieldTypeDescriptor, GDayDescriptor, GMonthDayDescriptor, GMonthDescriptor, GYearDescriptor, GYearMonthDescriptor, IncludeDescriptor, IncludeTypeDescriptor, InterfaceDescriptor, IntrospectedXMLClassDescriptor, JndiDescriptor, KeyGeneratorDefDescriptor, LdapDescriptor, ListClassDescriptor, MappingDescriptor, MappingRootDescriptor, MapToDescriptor, MarshalFramework.InternalXMLClassDescriptor, MonthDescriptor, NamingTypeDescriptor, NamingXMLTypeDescriptor, PackageTypeChoiceDescriptor, PackageTypeDescriptor, ParamDescriptor, ParamDescriptor, PathTypeDescriptor, RecurringDurationDescriptor, RootArrayDescriptor, SqlDescriptor, StringClassDescriptor, TimeDescriptor, TimeDurationDescriptor, TimePeriodDescriptor, TypeTypeDescriptor, VectorClassDescriptor, XMLClassDescriptorAdapter, XMLClassDescriptorImpl, YearDescriptor

public interface XMLClassDescriptor
extends ClassDescriptor

A class descriptor for describing relationships between a Class and an XML element or complexType. This class implements org.exolab.castor.mapping.ClassDescriptor, yet adds extra methods for handling XML. All fields are of type XMLFieldDescriptor.
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:16 $
Author:
Keith Visco

Method Summary

boolean
canAccept(String fieldName, Object object)
Returns true if the given object represented by this XMLClassDescriptor can accept a member whose name is given.
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.
XMLFieldDescriptor
getFieldDescriptor(String name, NodeType nodeType)
Returns the XML field descriptor matching the given xml name and nodeType.
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.

Methods inherited from interface org.exolab.castor.mapping.ClassDescriptor

getAccessMode, getExtends, getFields, getIdentity, getJavaClass

Method Details

canAccept

public boolean canAccept(String fieldName,
                         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). Different reasons can change the acceptance criteria, this is the reason why each implementation of XMLClassDescriptor must define these reasons.
Parameters:
fieldName - the name of the field to check
object - the object represented by this XMLCLassDescriptor
Returns:
true if the given object represented by this XMLClassDescriptor can accept a member whose name is given.

getAttributeDescriptors

public XMLFieldDescriptor[] getAttributeDescriptors()
Returns the set of XMLFieldDescriptors for all members that should be marshalled as XML attributes. This includes namespace nodes.
Returns:
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.
Returns:
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.
Returns:
an array of XMLFieldDescriptors for all members that should be marshalled as XML elements.

getFieldDescriptor

public XMLFieldDescriptor getFieldDescriptor(String name,
                                             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.
Parameters:
name - the xml name to match against
Returns:
the matching descriptor, or null if no matching descriptor is available.

getNameSpacePrefix

public String getNameSpacePrefix()
Returns:
the namespace prefix to use when marshalling as XML.

getNameSpaceURI

public String getNameSpaceURI()
Returns:
the namespace URI used when marshalling and unmarshalling as XML.

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.
Returns:
the type validator for the class described by this ClassDescriptor.

getXMLName

public String getXMLName()
Returns the XML Name for the Class being described.
Returns:
the XML name.

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com