|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Class interface defines methods to describe a Class meta object. A Class is composed by a set of fields (primitive, reference class or reference generic class), a set of inherited classes, a mapping class, can be abstract or not and has a name.
Method Summary | |
void |
addClassProject(java.lang.String projectName,
ClassProject classProject)
Adds a ClassProject object. |
void |
addSubClass(Class class_)
Adds a new class to the list of the derived classes for the current class object. |
void |
addSuperClass(Class class_)
Adds a new inherited class to the list of the inherited classes for the current class object. |
ClassProject |
createClassProject(java.lang.String projectName)
Creates a new ClassProject object. |
ClassRef |
createClassRef(java.lang.String fieldName,
Class class_)
Allows to obtain a new ClassRef from a field name an its class. |
GenClassRef |
createGenClassRef(java.lang.String fieldName,
java.lang.String genName)
Allows to obtain a new GenClassRef from a field name an its generic class. |
ScalarField |
createHiddenField(java.lang.String fieldname,
PType type,
int size,
int scale)
Creates an hiddenfield for the current Class object. |
NameDef |
createNameDef()
Creates a new NameDef object for the current Class object. |
PrimitiveElement |
createPrimitiveElement(java.lang.String fieldName,
PType type,
int size,
int scale)
Allows to obtain a new PrimitiveElement from a class field name an its type. |
boolean |
detectFilterElementNotInPK(Expression exp,
NameDef nd)
Return true if one element of the expression exp is not part of the namedef. |
boolean |
generateKFPNC()
Return true if the KFPNC has to be generated. |
java.util.List |
getAllAncestors()
Return all the ancestors in the inheritance graph. |
java.util.Collection |
getAllFields()
Returns an iterator on existing class fields + fields from super classes. |
java.util.Collection |
getAllHiddenFields()
|
java.util.List |
getAncestors()
Returns only the top ancestors. |
ClassMapping |
getClassMapping(java.lang.String projectName,
java.lang.String mapperName)
Returns a ClassMapping object. |
ClassProject |
getClassProject(java.lang.String projectName)
Returns a ClassProject object. |
java.util.Collection |
getClassProjects()
Returns a collection of ClassProject objects. |
java.lang.String |
getConstantValue(java.lang.String fieldName)
Obtains the value of a constant PrimitiveElement, defined either in the current class or in one of its ancestors. |
int |
getFieldRefNumber()
Returns the number of fields which are references to classes. |
java.util.Collection |
getFields()
Returns an iterator on existing class fields. |
java.lang.String |
getFileName()
Allows to retrieve the file name of this class MO. |
java.lang.String |
getFQName()
Gets the fully qualified name (including the package name) associated with this class. |
ScalarField |
getHiddenField(java.lang.String fieldname)
Retrieve the hiddenfield identified by its name in the current class. |
java.util.Collection |
getHiddenFields()
|
Expression |
getInheritanceFilter(NameDef nd)
|
java.lang.Object |
getInheritanceNamingKey(NameDef nd)
|
int |
getInheritedClassNumber()
Returns the number of inherited classes for the current Class object. |
java.lang.String |
getName()
Allows to know the name of the current class object. |
NameDef |
getNameDef(java.lang.String projectName)
Returns a NameDef object from a given mapperName and mappingName. |
java.util.Collection |
getNameDefs()
|
Package |
getPackage()
|
PType |
getPType()
|
java.util.Collection |
getSubClasses()
Allows us to obtain all classes derived from the current class object. |
Class |
getSuperClass(java.lang.String fqcn)
Retrieves a super class whith its name. |
java.util.Collection |
getSuperClasses()
Retrieves the collection of super classes |
TypedElement |
getTypedElement(java.lang.String fieldName)
Allows to obtain an existing Field. |
boolean |
isAbstract()
Allows to know if the current class is an abstract class or not. |
boolean |
isPolymorphic()
Returns true if the class is polymorphic, i.e. |
ClassProject |
removeClassProject(java.lang.String projectname)
Removes a ClassProject instance. |
TypedElement |
removeTypedElement(java.lang.String fieldName)
Removes a typed element. |
void |
setAbstract(boolean isAbstract)
|
void |
setConstantValue(java.lang.String fieldName,
java.lang.String cv)
Defines the value of a constant PrimitiveElement, defined either in the current class or in one of its ancestors. |
void |
setFileName(java.lang.String filename)
Allows to assign the file name of this class MO. |
void |
setInheritanceFilter(NameDef nd,
Expression filter)
|
void |
setInheritanceNamingKey(NameDef nd,
java.lang.Object key)
|
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject |
getParent, setParent |
Method Detail |
public Package getPackage()
public java.lang.String getFileName()
public void setFileName(java.lang.String filename)
filename
- The file name.public boolean isAbstract()
public void setAbstract(boolean isAbstract)
public java.lang.String getName()
public java.lang.String getFQName()
public TypedElement getTypedElement(java.lang.String fieldName)
fieldName
- the name of the class field
public TypedElement removeTypedElement(java.lang.String fieldName)
fieldName
- is the name of the field to be removed
public NameDef createNameDef()
public ScalarField createHiddenField(java.lang.String fieldname, PType type, int size, int scale)
fieldname
- the name of the hiddenfieldtype
- the ptype of the hiddenfieldsize
- is the
public java.util.Collection getHiddenFields()
public java.util.Collection getAllHiddenFields()
public ScalarField getHiddenField(java.lang.String fieldname)
fieldname
- the name of the hiddenfield.
public NameDef getNameDef(java.lang.String projectName)
projectName
- the name of the class project
public java.util.Collection getNameDefs()
public Expression getInheritanceFilter(NameDef nd) throws ExpressionException
ExpressionException
public java.lang.Object getInheritanceNamingKey(NameDef nd)
public void setInheritanceNamingKey(NameDef nd, java.lang.Object key)
public void setInheritanceFilter(NameDef nd, Expression filter)
filter
- is the filter expression (Medor expression) permitting to
known if instance of the parent class is in fact an instance of the
current persistent class. The filter uses the field name (composite field
in case of a composite or the field class name).public PrimitiveElement createPrimitiveElement(java.lang.String fieldName, PType type, int size, int scale)
fieldName
- the name of the primitive fieldtype
- the PType of the primitive field
public void setConstantValue(java.lang.String fieldName, java.lang.String cv)
The constant value is represented by a String.
fieldName
- the existing PrimitiveElementcv
- the constant valuepublic java.lang.String getConstantValue(java.lang.String fieldName)
The constant value is represented by a String.
fieldName
- the existing PrimitiveElement
public ClassRef createClassRef(java.lang.String fieldName, Class class_)
fieldName
- the name of the fieldclass_
- the class meta-object which represents the reference of
the field
public GenClassRef createGenClassRef(java.lang.String fieldName, java.lang.String genName)
fieldName
- the name of the fieldgenName
- the GenClass object which represents the reference of
the field
public java.util.Collection getFields()
public java.util.Collection getAllFields()
public java.util.Collection getSubClasses()
public java.util.Collection getSuperClasses()
public Class getSuperClass(java.lang.String fqcn)
fqcn
- is the fully qualified class name of the super class
public void addSuperClass(Class class_)
class_
- the inherited class to add to inherited classes listpublic void addSubClass(Class class_)
class_
- the inherited class to add to inherited classes listpublic int getInheritedClassNumber()
public PType getPType()
public int getFieldRefNumber()
public ClassProject getClassProject(java.lang.String projectName)
projectName
- a project name.
public ClassMapping getClassMapping(java.lang.String projectName, java.lang.String mapperName)
projectName
- a project name,
mappername a mapper name.
public java.util.Collection getClassProjects()
public void addClassProject(java.lang.String projectName, ClassProject classProject)
projectName
- a project name,
classProject a ClassProject object.public ClassProject createClassProject(java.lang.String projectName)
projectName
- the name of the project.
public ClassProject removeClassProject(java.lang.String projectname)
projectname
- is the name of removed ClassProject
public java.util.List getAncestors()
public java.util.List getAllAncestors()
public boolean isPolymorphic()
public boolean generateKFPNC() throws ExpressionException
ExpressionException
public boolean detectFilterElementNotInPK(Expression exp, NameDef nd) throws ExpressionException
ExpressionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |