public class ClassDescriptorImpl extends Object implements ClassDescriptor
ClassDescriptor
implementation, holding general OO information
about the class described.
Engines will use Nature
s to augment this class with engine-specific knowledge
and functionality, using addNature(String)
to register these views
with this class.
Once a Nature has been registered with this ClassDescriptor
, the nature
can be applied to the ClassDescriptor
and nature-specific properties
can be accessed in a type-safe way.Nature
,
addNature(String)
,
hasNature(String)
Constructor and Description |
---|
ClassDescriptorImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addNature(String nature)
Adds a specified nature.
|
ClassDescriptor |
getDepends()
Returns the
ClassDescriptor of the class which this class
depends upon. |
ClassDescriptor |
getExtends()
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 the
FieldDescriptor s that describe the identities as defined for this class. |
FieldDescriptor |
getIdentity()
Returns the first
FieldDescriptor instance. |
Class<?> |
getJavaClass()
Returns the Java class represented by this descriptor.
|
ClassMapping |
getMapping()
Returns the
ClassMapping instance used. |
Object |
getProperty(String name)
Get a property by its name.
|
boolean |
hasNature(String nature)
Checks if a specified nature has been added.
|
void |
setDepends(ClassDescriptor depends)
Sets the
ClassDescriptor of the class which this class
depends upon. |
void |
setExtends(ClassDescriptor extend)
Sets the descriptor of the class which this class extends.
|
void |
setFields(FieldDescriptor[] fields)
Sets the
FieldDescriptor s that describe the fields defined for this class. |
void |
setIdentities(FieldDescriptor[] identities)
Sets the
FieldDescriptor s that describe the identities as defined for this class. |
void |
setJavaClass(Class<?> javaClass)
Sets the Java
Class as described by this descriptor. |
void |
setMapping(ClassMapping mapping)
Sets the
ClassMapping instance. |
void |
setProperty(String name,
Object value)
Set a property specified by the name to the passed value.
|
String |
toString() |
public void setMapping(ClassMapping mapping)
ClassMapping
instance.mapping
- The ClassMapping
instance to be used.public ClassMapping getMapping()
ClassMapping
instance used.ClassMapping
instance used.public void setJavaClass(Class<?> javaClass)
Class
as described by this descriptor.javaClass
- The Java Class
instance as described by this descriptor.public Class<?> getJavaClass()
getJavaClass
in interface ClassDescriptor
ClassDescriptor.getJavaClass()
public void setExtends(ClassDescriptor extend)
extend
- the descriptor of the class which this class extends.public ClassDescriptor getExtends()
getExtends
in interface ClassDescriptor
ClassDescriptor.getExtends()
public void setDepends(ClassDescriptor depends)
ClassDescriptor
of the class which this class
depends upon.depends
- the ClassDescriptor
of the class which this class
depends uponpublic ClassDescriptor getDepends()
ClassDescriptor
of the class which this class
depends upon.ClassDescriptor
of the class which this class
depends upon.public void setFields(FieldDescriptor[] fields)
FieldDescriptor
s that describe the fields defined for this class.fields
- the FieldDescriptor
s that describe the fields defined for this class.public FieldDescriptor[] getFields()
getFields
in interface ClassDescriptor
ClassDescriptor.getFields()
public String toString()
toString
in class Object
Object.toString()
public Object getProperty(String name)
PropertyHolder
getProperty
in interface PropertyHolder
name
- of the propertygetProperty(java.lang.String)
public void setProperty(String name, Object value)
PropertyHolder
setProperty
in interface PropertyHolder
name
- of the propertyvalue
- of the propertysetProperty(java.lang.String, java.lang.Object)
public void addNature(String nature)
NatureExtendable
addNature
in interface NatureExtendable
nature
- ID of the NatureaddNature(java.lang.String)
public boolean hasNature(String nature)
NatureExtendable
hasNature
in interface NatureExtendable
nature
- ID of the NaturehasNature(java.lang.String)
public void setIdentities(FieldDescriptor[] identities)
FieldDescriptor
s that describe the identities as defined for this class.identities
- the FieldDescriptor
s that describe the identities as defined
for this class.public FieldDescriptor[] getIdentities()
FieldDescriptor
s that describe the identities as defined for this class.FieldDescriptor
s that describe the identities as defined for this class.public FieldDescriptor getIdentity()
FieldDescriptor
instance.getIdentity
in interface ClassDescriptor
FieldDescriptor
instanceCopyright © 2017. All rights reserved.