|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jorm.metainfo.lib.BasicMetaObject
org.objectweb.jorm.metainfo.lib.BasicClass
BasicClass is an implementation of the Class interface defined in the meta information system. This object is defined by a list of fields, a name, a list of mapping.
Field Summary |
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject |
debug, logger, loggerFactory, parent |
Constructor Summary | |
BasicClass(java.lang.String className,
MetaObject parent)
Builds a new Class object. |
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 a new scalar field and adds it to the list of hidden fields. |
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()
Determine if we need to generate the kfpnc. |
java.util.List |
getAllAncestors()
Returns all the ancestors of the class, i.e.: A --------- | | B C ----- | D all ancestors of D are C and A. |
java.util.Collection |
getAllFields()
Returns an iterator on existing class fields + fields from super classes. |
java.util.Collection |
getAllHiddenFields()
|
java.util.List |
getAncestors()
Return the list (most often with only one element) of ancestors. |
protected java.util.Collection |
getChildren()
|
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 an hiddenfield from its name. |
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 name)
Returns a NameDef object. |
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()
Returns a collection of Class objects. |
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. it has subclasses or superclasses |
protected java.util.List |
listAllFields(java.util.List allFields)
|
protected java.util.List |
listAllHiddenField(java.util.List allFields)
|
protected java.util.List |
listField()
returns an ArrayList which contains the current fields. |
protected java.util.List |
listField(java.util.List allFields)
|
protected java.util.List |
listHiddenFields(java.util.List allFields)
|
Expression |
parseInheritanceFilter(java.lang.String filter,
NameDef nd)
|
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 e)
|
void |
setInheritanceNamingKey(NameDef nd,
java.lang.Object key)
|
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject |
getLogger, getLoggerFactory, getManager, getParent, setLogger, setLoggerFactory, setLoggingOnChild, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject |
getParent, setParent |
Constructor Detail |
public BasicClass(java.lang.String className, MetaObject parent)
className
- the name of the current classparent
- the parent of the current objectMethod Detail |
protected java.util.Collection getChildren()
getChildren
in class BasicMetaObject
public Package getPackage()
getPackage
in interface Class
public java.lang.String getFileName()
getFileName
in interface Class
public void setFileName(java.lang.String filename)
setFileName
in interface Class
filename
- The file name.public boolean isAbstract()
isAbstract
in interface Class
public void setAbstract(boolean isAbstract)
setAbstract
in interface Class
public java.lang.String getName()
getName
in interface Class
public java.lang.String getFQName()
Class
getFQName
in interface Class
public TypedElement getTypedElement(java.lang.String fieldName)
getTypedElement
in interface Class
fieldName
- the name of the class field
public TypedElement removeTypedElement(java.lang.String fieldName)
removeTypedElement
in interface Class
fieldName
- is the name of the field to be removed
public NameDef createNameDef()
createNameDef
in interface Class
public NameDef getNameDef(java.lang.String name)
getNameDef
in interface Class
name
- the name of a NameDef object.
public java.util.Collection getNameDefs()
getNameDefs
in interface Class
public Expression getInheritanceFilter(NameDef nd) throws ExpressionException
getInheritanceFilter
in interface Class
ExpressionException
public java.lang.Object getInheritanceNamingKey(NameDef nd)
getInheritanceNamingKey
in interface Class
public void setInheritanceFilter(NameDef nd, Expression e)
setInheritanceFilter
in interface Class
e
- 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 void setInheritanceNamingKey(NameDef nd, java.lang.Object key)
setInheritanceNamingKey
in interface Class
public PrimitiveElement createPrimitiveElement(java.lang.String fieldName, PType type, int size, int scale)
createPrimitiveElement
in interface Class
fieldName
- the name of the primitive fieldtype
- the PType of the primitive field
public void setConstantValue(java.lang.String fieldName, java.lang.String cv)
Class
The constant value is represented by a String.
setConstantValue
in interface Class
fieldName
- the existing PrimitiveElementcv
- the constant valuepublic java.lang.String getConstantValue(java.lang.String fieldName)
Class
The constant value is represented by a String.
getConstantValue
in interface Class
fieldName
- the existing PrimitiveElement
public ScalarField createHiddenField(java.lang.String fieldName, PType type, int size, int scale)
createHiddenField
in interface Class
fieldName
- the name of the field to createtype
- the type of the field to createsize
- is the
public ClassRef createClassRef(java.lang.String fieldName, Class class_)
createClassRef
in interface Class
fieldName
- the name of the fieldclass_
- the string representation of the class which represents
the reference of the field
public GenClassRef createGenClassRef(java.lang.String fieldName, java.lang.String genName)
createGenClassRef
in interface Class
fieldName
- the name of the fieldgenName
- the GenClass object which represents the reference of
the field
protected java.util.List listField()
protected java.util.List listField(java.util.List allFields)
protected java.util.List listAllFields(java.util.List allFields)
public java.util.Collection getFields()
Class
getFields
in interface Class
public java.util.Collection getAllFields()
Class
getAllFields
in interface Class
protected java.util.List listHiddenFields(java.util.List allFields)
protected java.util.List listAllHiddenField(java.util.List allFields)
public java.util.Collection getHiddenFields()
getHiddenFields
in interface Class
public java.util.Collection getAllHiddenFields()
getAllHiddenFields
in interface Class
public ScalarField getHiddenField(java.lang.String fieldName)
getHiddenField
in interface Class
fieldName
- the name of the hiddenfield.
public java.util.Collection getSubClasses()
Class
getSubClasses
in interface Class
public java.util.Collection getSuperClasses()
getSuperClasses
in interface Class
public Class getSuperClass(java.lang.String fqcn)
Class
getSuperClass
in interface Class
fqcn
- is the fully qualified class name of the super class
public void addSuperClass(Class class_)
addSuperClass
in interface Class
class_
- the inherited class to add to inherited classes listpublic void addSubClass(Class class_)
Class
addSubClass
in interface Class
class_
- the inherited class to add to inherited classes listpublic int getInheritedClassNumber()
getInheritedClassNumber
in interface Class
public java.util.List getAllAncestors()
getAllAncestors
in interface Class
public java.util.List getAncestors()
getAncestors
in interface Class
public boolean isPolymorphic()
Class
isPolymorphic
in interface Class
public PType getPType()
getPType
in interface Class
public int getFieldRefNumber()
getFieldRefNumber
in interface Class
public ClassProject getClassProject(java.lang.String projectName)
getClassProject
in interface Class
projectName
- a project name.
public ClassMapping getClassMapping(java.lang.String projectName, java.lang.String mapperName)
getClassMapping
in interface Class
projectName
- a project name,
mappername a mapper name.
public java.util.Collection getClassProjects()
getClassProjects
in interface Class
public void addClassProject(java.lang.String projectName, ClassProject classProject)
addClassProject
in interface Class
projectName
- a project name,
classProject a ClassProject object.public ClassProject createClassProject(java.lang.String projectName)
createClassProject
in interface Class
projectName
- the name of the project.
public ClassProject removeClassProject(java.lang.String projectname)
removeClassProject
in interface Class
projectname
- is the name of removed ClassProject
public Expression parseInheritanceFilter(java.lang.String filter, NameDef nd) throws ExpressionException
ExpressionException
public boolean generateKFPNC() throws ExpressionException
generateKFPNC
in interface Class
ExpressionException
public boolean detectFilterElementNotInPK(Expression exp, NameDef nd) throws ExpressionException
Class
detectFilterElementNotInPK
in interface Class
ExpressionException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |