|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.castor.cpa.jpa.info.ClassInfo
public final class ClassInfo
This class holds the necessary information so that Castor can properly map a
JPA annotated Class to the database.
| Constructor Summary | |
|---|---|
ClassInfo()
Creates a new empty ClassInfo. |
|
ClassInfo(java.lang.Class<?> describedClass)
Creates a new ClassInfo, describing a given Class. |
|
| Method Summary | |
|---|---|
void |
addFieldInfo(FieldInfo fieldInfo)
Add a FieldInfo to this ClassInfo; if the
FieldInfo is already in the set of fields, it is NOT added a
second time (FieldInfos are unique). |
void |
addKey(FieldInfo key)
Add a FieldInfo to the key set of this ClassInfo (keys and
attributes are disjunct!). |
void |
addNature(java.lang.String nature)
Adds a specified nature. |
java.lang.Class<?> |
getDescribedClass()
Returns the reference to the Class object that is described by
this ClassInfo. |
java.lang.Class<?> |
getExtendedClass()
Get the reference to the Class object that is extended by this class. |
int |
getFieldCount()
Indicates the number of FieldInfos already known to this
ClassInfo. |
FieldInfo |
getFieldInfoByName(java.lang.String memberName)
Returns a FieldInfo that corresponds to an element with the given
node name. |
java.util.Set<FieldInfo> |
getFieldInfos()
Returns Set of associated fields. |
int |
getKeyFieldCount()
|
FieldInfo |
getKeyFieldInfoByName(java.lang.String keyName)
Returns a FieldInfo that corresponds to a key element with the
given node name. |
java.util.Set<FieldInfo> |
getKeyFieldInfos()
Returns Set of key fields. |
java.lang.Object |
getProperty(java.lang.String name)
Get a property by its name. |
boolean |
hasNature(java.lang.String nature)
Checks if a specified nature has been added. |
void |
setDescribedClass(java.lang.Class<?> describedClass)
Sets the Class that is described by this ClassInfo. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set a property specified by the name to the passed value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassInfo()
public ClassInfo(java.lang.Class<?> describedClass)
describedClass - the Class that is described by this ClassInfo.| Method Detail |
|---|
public void addNature(java.lang.String nature)
addNature in interface NatureExtendablenature - the name of the natureNatureExtendable.addNature(java.lang.String)public boolean hasNature(java.lang.String nature)
hasNature in interface NatureExtendablenature - the name of the nature.
NatureExtendable.hasNature(java.lang.String)public java.lang.Object getProperty(java.lang.String name)
getProperty in interface PropertyHoldername - the name of the property to get.
PropertyHolder.getProperty(java.lang.String)
public void setProperty(java.lang.String name,
java.lang.Object value)
setProperty in interface PropertyHoldername - the name of the property to set.value - the value to set the specified property to.PropertyHolder.setProperty(java.lang.String,
java.lang.Object)public java.lang.Class<?> getDescribedClass()
Class object that is described by
this ClassInfo.
public void setDescribedClass(java.lang.Class<?> describedClass)
Class that is described by this ClassInfo.
describedClass - The Class that is described by this ClassInfo.public void addFieldInfo(FieldInfo fieldInfo)
FieldInfo to this ClassInfo; if the
FieldInfo is already in the set of fields, it is NOT added a
second time (FieldInfos are unique).
fieldInfo - The FieldInfo to add to this ClassInfopublic int getFieldCount()
FieldInfos already known to this
ClassInfo.
FieldInfo definitions for this
ClassInfo.public FieldInfo getFieldInfoByName(java.lang.String memberName)
FieldInfo that corresponds to an element with the given
node name.
memberName - the name of the field to get.
FieldInfo that corresponds to an element with the given
node name or null if that field does not exist.public java.util.Set<FieldInfo> getFieldInfos()
public void addKey(FieldInfo key)
FieldInfo to the key set of this ClassInfo (keys and
attributes are disjunct!). It is only inserted once in each of these
lists, so normal elements can be "raised" to be keys after first adding
them to the class.
key - - the FieldInfo to add to the set of key fields.public int getKeyFieldCount()
FieldInfo definitions for this ClassInfo's
key.public FieldInfo getKeyFieldInfoByName(java.lang.String keyName)
FieldInfo that corresponds to a key element with the
given node name.
keyName - the name of the key field to get.
FieldInfo that corresponds to a key element with the
given node name or null if that field is not in the key set.public java.util.Set<FieldInfo> getKeyFieldInfos()
public java.lang.Class<?> getExtendedClass()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||