|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class defines the rtti aspect.
It allows the programmer to add some runtime type information on the classes of its applications.
Some configuration methods are useless since the type information is retrieved through bytecode analysis. They are kept in the interface in case of.
ClassItem
,
MethodItem
,
FieldItem
,
CollectionItem
Method Summary | |
void |
addAccessedFields(MethodItem method,
String[] accessedFields)
Adds some accessed fields to a given method. |
void |
addAdder(CollectionItem collection,
String method)
Adds an adding method for a collection |
void |
addDependentField(FieldItem field,
String dependentField)
Declares a field dependency. |
void |
addRemover(CollectionItem collection,
String method)
Adds a removing method for a collection |
void |
addRoot(String name)
This configuration method defines root objects. |
void |
addWrittenFields(AbstractMethodItem method,
String[] writtenFields)
Adds some written fields to a given method. |
void |
declareCalculatedField(ClassItem cl,
String fieldName,
String getterName)
Declare a calculated field, which is a field with only a getter and no actual field. |
void |
definePrimaryKey(CollectionItem collection,
String[] fields)
Defines primary keys for a collection. |
void |
defineRepository(ClassItem type,
String repositoryName,
CollectionItem repositoryCollection)
Declare a repository to which all instances of type will be automatically added. |
void |
introduce(ClassItem target,
ClassItem roleType,
String memberType,
String memberName)
Introduces a new member (field or method) into a given class. |
void |
newVirtualClass(String className,
ClassItem actualType)
Create a new virtual class. |
void |
setAdder(CollectionItem collection,
String method)
Sets the adder of a collection. |
void |
setClass(ClassItem cli,
String className)
Sets a user defined class on a class. |
void |
setClass(MemberItem member,
String className)
Sets a user defined class on a class' member. |
void |
setClonedFields(String className,
String[] fields)
This configuration method tells that the fields (references or collections) must be cloned when the class is cloned. |
void |
setComponentType(CollectionItem collection,
String type)
Sets the component type of a collection, i.e. |
void |
setFieldType(FieldItem field,
String type)
Declare a field to be of a given type |
void |
setIndexedField(CollectionItem collection,
FieldItem indexedField)
Tells that a Map implementing a collection indexes a field of the contained objects. |
void |
setIsIndex(CollectionItem collection,
boolean isIndex)
Specify wether a Map implementing a collection is a mere index for the collection (this is not the default). |
void |
setNullAllowed(FieldItem cli)
This configuration method tells that the field can be set to null (forbidden by default) |
void |
setNullAllowed(FieldItem field,
boolean allowed)
This configuration method tells wether the field can be set to null or not. |
void |
setNullAllowedParameters(AbstractMethodItem method,
boolean[] nulls)
Tells if JAC object-typed (references) arguments of a method can take null value while the method's invocation or if they should be choosen in existing instances list. |
void |
setParametersFields(AbstractMethodItem method,
FieldItem[] fields)
Specifies that the parameters of a method will be assigned to a given field. |
void |
setParametersType(AbstractMethodItem method,
String[] types)
Declare a method's parameters to be of a given type |
void |
setRemover(CollectionItem collection,
String method)
Sets the remover of a collection. |
Method Detail |
public void introduce(ClassItem target, ClassItem roleType, String memberType, String memberName)
The target class does not declare the member but is wrapped by a wrapper that contains a member that should be considered as a base-object member.
Once introduced, the member will behave like a regular member if accessed or setted through the RTTI.
target
- the target class where to add the memeberroleType
- the type of the role wrapper that actually
contains the memberpublic void addWrittenFields(AbstractMethodItem method, String[] writtenFields)
This configuration method must be used when a method changes some field values and does not follow the naming conventions (it is not a setter or an adder for instance).
method
- the methodwrittenFields
- some new fields the method writespublic void addAccessedFields(MethodItem method, String[] accessedFields)
This configuration method must be used when a method reads some field values and does not follow the naming conventions (it is not a getter for instance).
method
- the methodpublic void declareCalculatedField(ClassItem cl, String fieldName, String getterName)
cl
- the class item of te calculated fieldfieldName
- the name of the calculated fieldgetterName
- the name of the getter methodaddDependentField(FieldItem,String)
public void addDependentField(FieldItem field, String dependentField)
field
- the field to refreshdependentField
- the name of the field it depends on. It
must be in the same class ass field.declareCalculatedField(ClassItem,String,String)
public void addAdder(CollectionItem collection, String method)
collection
- the collection's namemethod
- the name of the adding methodpublic void setAdder(CollectionItem collection, String method)
collection
- the collectionmethod
- the name of the adder methodpublic void addRemover(CollectionItem collection, String method)
collection
- the collectionmethod
- the name of the removing methodpublic void setRemover(CollectionItem collection, String method)
collection
- the collection's namemethod
- the name of the remover methodpublic void setFieldType(FieldItem field, String type)
type
- the typepublic void setComponentType(CollectionItem collection, String type)
collection
- the collectiontype
- the component type of the collectionpublic void setParametersType(AbstractMethodItem method, String[] types)
method
- the methodpublic void newVirtualClass(String className, ClassItem actualType)
className
- name of the new classactualType
- the actual primitive type that is extendedpublic void defineRepository(ClassItem type, String repositoryName, CollectionItem repositoryCollection)
type
- the type of objects to add in the repositoryrepositoryName
- the name of the object holding the repositoryrepositoryCollection
- the collection to add the objects topublic void addRoot(String name)
Root objects are never garbaged since they are considered as an entry point to retrieve the application objects that are related to them.
name
- the name of the root objectpublic void setClonedFields(String className, String[] fields)
className
- the class namefields
- the names of the fields that are clonedpublic void setClass(ClassItem cli, String className)
cli
- the class to redefineclassName
- the new class namepublic void setClass(MemberItem member, String className)
member
- the member whose type to redefineclassName
- the new class namepublic void setParametersFields(AbstractMethodItem method, FieldItem[] fields)
Other aspects (such as the GUI aspect) may use this information to provide better default behaviour for the paramters.
method
- the of the methodfields
- an array of field items, one per parameter of the
method. Elements of this array may be null if some parameters
are not assigned to any field.public void setNullAllowed(FieldItem cli)
#setNullAllowed(ClassItem,String,boolean)
public void setNullAllowed(FieldItem field, boolean allowed)
field
- the fieldallowed
- wether to allow null values#setNullAllowed(ClassItem,String)
public void setNullAllowedParameters(AbstractMethodItem method, boolean[] nulls)
method
- the methodnulls
- a flags array that tells for each parameter whether
it can be null (true) or not (false). It has no effect if the
parameter is not a JAC object (a reference)public void setIsIndex(CollectionItem collection, boolean isIndex)
isIndex
- wether the map is an indexsetIndexedField(CollectionItem,FieldItem)
,
CollectionItem.getActualCollection(Object)
,
CollectionItem.getActualCollectionThroughAccessor(Object)
public void setIndexedField(CollectionItem collection, FieldItem indexedField)
setIsIndex(CollectionItem,boolean)
,
CollectionItem.getActualCollection(Object)
,
CollectionItem.getActualCollectionThroughAccessor(Object)
public void definePrimaryKey(CollectionItem collection, String[] fields)
It is used to check for double entries in the collection by checking the precised fields (it is the same as primary keys in a database).
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |