Package org.exolab.castor.mapping.loader
Class ClassDescriptorImpl
- java.lang.Object
-
- org.exolab.castor.mapping.loader.ClassDescriptorImpl
-
- All Implemented Interfaces:
NatureExtendable,PropertyHolder,ClassDescriptor
public class ClassDescriptorImpl extends java.lang.Object implements ClassDescriptor
The standardClassDescriptorimplementation, holding general OO information about the class described. Engines will useNatures to augment this class with engine-specific knowledge and functionality, usingaddNature(String)to register these views with this class. Once a Nature has been registered with thisClassDescriptor, the nature can be applied to theClassDescriptorand nature-specific properties can be accessed in a type-safe way.- Version:
- $Revision: 8727 $ $Date: 2006-01-07 15:48:31 -0700 (Sat, 07 Jan 2006) $
- Author:
- Assaf Arkin, Ralf Joachim, Werner Guttmann
- See Also:
Nature,addNature(String),hasNature(String)
-
-
Constructor Summary
Constructors Constructor Description ClassDescriptorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNature(java.lang.String nature)Adds a specified nature.ClassDescriptorgetDepends()Returns theClassDescriptorof the class which this class depends upon.ClassDescriptorgetExtends()Returns the class descriptor of the class extended by this class.FieldDescriptor[]getFields()Returns a list of fields represented by this descriptor.FieldDescriptor[]getIdentities()Returns theFieldDescriptors that describe the identities as defined for this class.FieldDescriptorgetIdentity()Returns the firstFieldDescriptorinstance.java.lang.Class<?>getJavaClass()Returns the Java class represented by this descriptor.ClassMappinggetMapping()Returns theClassMappinginstance used.java.lang.ObjectgetProperty(java.lang.String name)Get a property by its name.booleanhasNature(java.lang.String nature)Checks if a specified nature has been added.voidsetDepends(ClassDescriptor depends)Sets theClassDescriptorof the class which this class depends upon.voidsetExtends(ClassDescriptor extend)Sets the descriptor of the class which this class extends.voidsetFields(FieldDescriptor[] fields)Sets theFieldDescriptors that describe the fields defined for this class.voidsetIdentities(FieldDescriptor[] identities)Sets theFieldDescriptors that describe the identities as defined for this class.voidsetJavaClass(java.lang.Class<?> javaClass)Sets the JavaClassas described by this descriptor.voidsetMapping(ClassMapping mapping)Sets theClassMappinginstance.voidsetProperty(java.lang.String name, java.lang.Object value)Set a property specified by the name to the passed value.java.lang.StringtoString()
-
-
-
Method Detail
-
setMapping
public void setMapping(ClassMapping mapping)
Sets theClassMappinginstance.- Parameters:
mapping- TheClassMappinginstance to be used.
-
getMapping
public ClassMapping getMapping()
Returns theClassMappinginstance used.- Returns:
- The
ClassMappinginstance used.
-
setJavaClass
public void setJavaClass(java.lang.Class<?> javaClass)
Sets the JavaClassas described by this descriptor.- Parameters:
javaClass- The JavaClassinstance as described by this descriptor.
-
getJavaClass
public java.lang.Class<?> getJavaClass()
Returns the Java class represented by this descriptor.- Specified by:
getJavaClassin interfaceClassDescriptor- Returns:
- The Java class
- See Also:
ClassDescriptor.getJavaClass()
-
setExtends
public void setExtends(ClassDescriptor extend)
Sets the descriptor of the class which this class extends.- Parameters:
extend- the descriptor of the class which this class extends.
-
getExtends
public ClassDescriptor getExtends()
Returns the class descriptor of the class extended by this class.- Specified by:
getExtendsin interfaceClassDescriptor- Returns:
- The extended class descriptor
- See Also:
ClassDescriptor.getExtends()
-
setDepends
public void setDepends(ClassDescriptor depends)
Sets theClassDescriptorof the class which this class depends upon.- Parameters:
depends- theClassDescriptorof the class which this class depends upon
-
getDepends
public ClassDescriptor getDepends()
Returns theClassDescriptorof the class which this class depends upon.- Returns:
- the
ClassDescriptorof the class which this class depends upon.
-
setFields
public void setFields(FieldDescriptor[] fields)
Sets theFieldDescriptors that describe the fields defined for this class.- Parameters:
fields- theFieldDescriptors that describe the fields defined for this class.
-
getFields
public FieldDescriptor[] getFields()
Returns a list of fields represented by this descriptor.- Specified by:
getFieldsin interfaceClassDescriptor- Returns:
- A list of fields
- See Also:
ClassDescriptor.getFields()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Description copied from interface:PropertyHolderGet a property by its name.- Specified by:
getPropertyin interfacePropertyHolder- Parameters:
name- of the property- Returns:
- value of the property
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value)Description copied from interface:PropertyHolderSet a property specified by the name to the passed value.- Specified by:
setPropertyin interfacePropertyHolder- Parameters:
name- of the propertyvalue- of the property
-
addNature
public void addNature(java.lang.String nature)
Description copied from interface:NatureExtendableAdds a specified nature.- Specified by:
addNaturein interfaceNatureExtendable- Parameters:
nature- ID of the Nature
-
hasNature
public boolean hasNature(java.lang.String nature)
Description copied from interface:NatureExtendableChecks if a specified nature has been added.- Specified by:
hasNaturein interfaceNatureExtendable- Parameters:
nature- ID of the Nature- Returns:
- true if the Nature ID was added.
-
setIdentities
public void setIdentities(FieldDescriptor[] identities)
Sets theFieldDescriptors that describe the identities as defined for this class.- Parameters:
identities- theFieldDescriptors that describe the identities as defined for this class.
-
getIdentities
public FieldDescriptor[] getIdentities()
Returns theFieldDescriptors that describe the identities as defined for this class.- Returns:
- the
FieldDescriptors that describe the identities as defined for this class.
-
getIdentity
public FieldDescriptor getIdentity()
Returns the firstFieldDescriptorinstance.- Specified by:
getIdentityin interfaceClassDescriptor- Returns:
- the first
FieldDescriptorinstance
-
-