org.exolab.castor.mapping.loader

Class ClassDescriptorImpl

Implemented Interfaces:
ClassDescriptor
Known Direct Subclasses:
JDOClassDescriptor

public class ClassDescriptorImpl
extends java.lang.Object
implements ClassDescriptor

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

Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:29 $

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)
Constructor used by derived classes.
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.

Method Summary

void
checkValidity(Object object)
Checks the object validity.
AccessMode
getAccessMode()
ClassDescriptor
getDepends()
ClassDescriptor
getExtends()
FieldDescriptor[]
getFields()
FieldDescriptor[]
getIdentities()
FieldDescriptor
getIdentity()
Class
getJavaClass()
ClassMapping
getMapping()
void
setMapping(ClassMapping map)
String
toString()

Field Details

_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 Details

ClassDescriptorImpl

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


ClassDescriptorImpl

public ClassDescriptorImpl(Class javaClass,
                           FieldDescriptor[] fields,
                           FieldDescriptor[] identities,
                           ClassDescriptor extend,
                           ClassDescriptor depend,
                           AccessMode accessMode)
            throws MappingException
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
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)
            throws MappingException
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
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

Method Details

checkValidity

public void checkValidity(Object object)
            throws ValidityException,
                   IllegalStateException
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


getAccessMode

public AccessMode getAccessMode()
Specified by:
getAccessMode in interface ClassDescriptor


getDepends

public ClassDescriptor getDepends()


getExtends

public ClassDescriptor getExtends()
Specified by:
getExtends in interface ClassDescriptor


getFields

public FieldDescriptor[] getFields()
Specified by:
getFields in interface ClassDescriptor


getIdentities

public FieldDescriptor[] getIdentities()


getIdentity

public FieldDescriptor getIdentity()
Specified by:
getIdentity in interface ClassDescriptor


getJavaClass

public Class getJavaClass()
Specified by:
getJavaClass in interface ClassDescriptor


getMapping

public ClassMapping getMapping()


setMapping

public void setMapping(ClassMapping map)


toString

public String toString()


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