org.exolab.castor.mapping.loader

Class ClassDescriptorImpl

public class ClassDescriptorImpl extends Object implements ClassDescriptor

A basic class descriptor implementation. Engines will extend this class to provide additional functionality.

Version: $Revision: 1.3 $ $Date: 2005/07/15 21:59:17 $

Author: Assaf Arkin

Field Summary
protected FieldDescriptor[]_fields
The fields described for this class.
protected FieldDescriptor[]_identities
The field of the identity for this class.
Constructor Summary
ClassDescriptorImpl(Class javaClass, FieldDescriptor[] fields, FieldDescriptor[] identities, ClassDescriptor extend, ClassDescriptor depend, AccessMode accessMode)
Constructs a new descriptor for the specified class.
ClassDescriptorImpl(Class javaClass, FieldDescriptor[] fields, FieldDescriptor[] identities, ClassDescriptor extend, ClassDescriptor depend, AccessMode accessMode, boolean verifyConstructable)
Constructs a new descriptor for the specified class.
protected ClassDescriptorImpl(Class javaClass)
Constructor used by derived classes.
Method Summary
voidaddExtendedBy(ClassDescriptor classDesc)
voidcheckValidity(Object object)
Checks the object validity.
AccessModegetAccessMode()
ClassDescriptorgetDepends()
CollectiongetExtendedBy()
Returns a collection of class descriptors that extend this class descriptor.
ClassDescriptorgetExtends()
FieldDescriptor[]getFields()
FieldDescriptor[]getIdentities()
FieldDescriptorgetIdentity()
ClassgetJavaClass()
ClassMappinggetMapping()
booleanisExtended()
booleanisExtending()
voidsetMapping(ClassMapping map)
StringtoString()

Field Detail

_fields

protected final FieldDescriptor[] _fields
The fields described for this class.

_identities

protected final FieldDescriptor[] _identities
The field of the identity for this class.

Constructor Detail

ClassDescriptorImpl

public ClassDescriptorImpl(Class javaClass, FieldDescriptor[] fields, FieldDescriptor[] identities, ClassDescriptor extend, ClassDescriptor depend, AccessMode accessMode)
Constructs a new descriptor for the specified class. When describing inheritence, the descriptor of the parent class should be used and only the fields added in this object must be supplied here.

Parameters: javaClass The Java type of this class fields The fields described for this class identities The array of the identities (key) of this class, may be null extend The descriptor of the class which this class extends, accessMode The access mode for this class (null is shared) or null if this is a top-level class

Throws: MappingException The extended descriptor does not match a parent class of this type

ClassDescriptorImpl

public ClassDescriptorImpl(Class javaClass, FieldDescriptor[] fields, FieldDescriptor[] identities, ClassDescriptor extend, ClassDescriptor depend, AccessMode accessMode, boolean verifyConstructable)
Constructs a new descriptor for the specified class. When describing inheritence, the descriptor of the parent class should be used and only the fields added in this object must be supplied here.

Parameters: javaClass The Java type of this class fields The fields described for this class identities The field of the identities (key) of this class, may be null extend The descriptor of the class which this class extends, accessMode The access mode for this class (null is shared) or null if this is a top-level class

Throws: MappingException The extended descriptor does not match a parent class of this type

ClassDescriptorImpl

protected ClassDescriptorImpl(Class javaClass)
Constructor used by derived classes.

Method Detail

addExtendedBy

public void addExtendedBy(ClassDescriptor classDesc)

checkValidity

public void checkValidity(Object object)
Checks the object validity. Returns successfully if the object can be stored, is valid, etc, throws an exception otherwise.

Parameters: object The object

Throws: ValidityException The object is invalid, a required is null, or any other validity violation IllegalStateException The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object

getAccessMode

public AccessMode getAccessMode()

getDepends

public ClassDescriptor getDepends()

getExtendedBy

public Collection getExtendedBy()
Returns a collection of class descriptors that extend this class descriptor.

Returns: A collection of class descriptors.

getExtends

public ClassDescriptor getExtends()

getFields

public FieldDescriptor[] getFields()

getIdentities

public FieldDescriptor[] getIdentities()

getIdentity

public FieldDescriptor getIdentity()

getJavaClass

public Class getJavaClass()

getMapping

public ClassMapping getMapping()

isExtended

public boolean isExtended()

isExtending

public boolean isExtending()

setMapping

public void setMapping(ClassMapping map)

toString

public String toString()
Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com