public final class ClassInfo extends Object implements PropertyHolder
Class
to the database.Constructor and Description |
---|
ClassInfo()
Creates a new empty ClassInfo.
|
ClassInfo(Class<?> describedClass)
Creates a new ClassInfo, describing a given Class.
|
Modifier and Type | Method and Description |
---|---|
void |
addFieldInfo(FieldInfo fieldInfo)
|
void |
addKey(FieldInfo key)
Add a
FieldInfo to the key set of this ClassInfo (keys and
attributes are disjunct!). |
void |
addNature(String nature)
Adds a specified nature.
|
Class<?> |
getDescribedClass()
|
Class<?> |
getExtendedClass()
Get the reference to the Class object that is extended by this class.
|
int |
getFieldCount()
|
FieldInfo |
getFieldInfoByName(String memberName)
Returns a
FieldInfo that corresponds to an element with the given
node name. |
Set<FieldInfo> |
getFieldInfos()
Returns Set of associated fields.
|
int |
getKeyFieldCount() |
FieldInfo |
getKeyFieldInfoByName(String keyName)
Returns a
FieldInfo that corresponds to a key element with the
given node name. |
Set<FieldInfo> |
getKeyFieldInfos()
Returns Set of key fields.
|
Object |
getProperty(String name)
Get a property by its name.
|
boolean |
hasNature(String nature)
Checks if a specified nature has been added.
|
void |
setDescribedClass(Class<?> describedClass)
|
void |
setProperty(String name,
Object value)
Set a property specified by the name to the passed value.
|
public ClassInfo()
public ClassInfo(Class<?> describedClass)
describedClass
- the Class that is described by this ClassInfo.public void addNature(String nature)
addNature
in interface NatureExtendable
nature
- the name of the natureNatureExtendable.addNature(java.lang.String)
public boolean hasNature(String nature)
hasNature
in interface NatureExtendable
nature
- the name of the nature.NatureExtendable.hasNature(java.lang.String)
public Object getProperty(String name)
getProperty
in interface PropertyHolder
name
- the name of the property to get.PropertyHolder.getProperty(java.lang.String)
public void setProperty(String name, Object value)
setProperty
in interface PropertyHolder
name
- 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 Class<?> getDescribedClass()
public void setDescribedClass(Class<?> describedClass)
public void addFieldInfo(FieldInfo fieldInfo)
public int getFieldCount()
public FieldInfo getFieldInfoByName(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 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(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 Set<FieldInfo> getKeyFieldInfos()
public Class<?> getExtendedClass()
Copyright © 2014. All rights reserved.