|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.rtti.MetaItem | +--org.objectweb.jac.core.rtti.MetaItemDelegate | +--org.objectweb.jac.core.rtti.MemberItem | +--org.objectweb.jac.core.rtti.AbstractMethodItem
This class defines a meta item that corresponds to the
java.lang.reflect.Method
and to the
java.lang.reflect.Constructor
meta elements.
It appears that methods and contructors can be seen as semantically similar (a constructor is nothing else that a special static method that returns an object that is of the owner class type). Thus, we decide to wrap those two meta item into a unique one (on contrary to the Java choice)
Field Summary |
Fields inherited from class org.objectweb.jac.core.rtti.MemberItem |
role, roleClassType, roleName, roleType |
Fields inherited from class org.objectweb.jac.core.rtti.MetaItemDelegate |
delegate, parent |
Fields inherited from class org.objectweb.jac.core.rtti.MetaItem |
attrACs |
Constructor Summary | |
AbstractMethodItem(Object delegate,
ClassItem parent)
Default contructor to create a new abstract method item. |
Method Summary | |
void |
addAccessedField(FieldItem accessedField)
Adds a new accessed field for this method. |
void |
addModifiedCollection(CollectionItem modifiedCollection)
Adds a new modified collection for this method. |
void |
addWrittenField(FieldItem writtenField)
Adds a new written field for this method. |
CollectionItem[] |
getAccessedCollections()
|
FieldItem[] |
getAccessedFields()
Gets the value of the fields that are written by this method. |
FieldItem[] |
getAccessedReferences()
Gets the value of the fields that are written by this method. |
CollectionItem |
getAddedCollection()
Get the value of the collection that is added by this method (the method is the unique adder of the collection). |
abstract CollectionItem[] |
getAddedCollections()
|
Object |
getAttribute(String name)
If the field does not have a value for the request attribute, tries on the superclass. |
String |
getCompactFullName()
Return the full method name, ie with short parameter types. |
AbstractMethodItem |
getConcreteMethod()
Returns the method item who really holds the byte code. |
String |
getFullName()
Return the full method name, ie with parameter types. |
static String |
getFullName(String name,
Class[] pts)
|
String |
getLongName()
Returns the name prfixed with the owning class name. |
CollectionItem[] |
getModifiedCollections()
Gets the value of the collections that are modified by this method. |
ClassItem |
getOwningClass()
Returns the owning class of this method. |
Object |
getParameter(Object[] params,
int i)
|
int |
getParameterCount()
Gets the number of parameters |
ClassItem |
getParameterTypeItem(int n)
Get the ClassItem of the type of a parameter of the method. |
abstract Class[] |
getParameterTypes()
Gets the parameter types of this abstract method item. |
String |
getRealFullName()
Return the full method name, ie with parameter types. |
abstract CollectionItem[] |
getRemovedCollections()
|
abstract FieldItem |
getSetField()
|
String |
getTypedName()
Returns |
FieldItem[] |
getWrittenFields()
Gets the value of the fields that are written by this method. |
boolean |
hasModifiedCollections()
Returns true if the method has at least one modified collection |
boolean |
hasWrittenFields()
|
Object |
invoke(Object object,
Object[] parameters)
|
abstract boolean |
isAccessor()
|
abstract boolean |
isAdder()
|
abstract boolean |
isCollectionAccessor()
|
abstract boolean |
isCollectionGetter()
|
abstract boolean |
isCollectionSetter()
|
abstract boolean |
isFieldGetter()
|
abstract boolean |
isFieldSetter()
|
abstract boolean |
isGetter()
|
boolean |
isModifier()
Tells wether the method modifies the state of the object |
abstract boolean |
isReferenceAccessor()
|
abstract boolean |
isReferenceGetter()
|
abstract boolean |
isReferenceSetter()
|
abstract boolean |
isRemover()
|
abstract boolean |
isSetter()
|
boolean |
isStatic()
|
abstract boolean |
isWriter()
|
void |
removeAccessedField(FieldItem field)
Removes an accessed field for this method. |
void |
removeWrittenField(FieldItem field)
Removes a new written field for this method. |
void |
setAccessedFields(FieldItem[] accessedFields)
Sets the value of the fields that are read by this method. |
void |
setParameter(Object[] params,
int i,
Object value)
|
void |
setWrittenFields(FieldItem[] writtenFields)
Sets the value of the fields that are written by this method. |
String |
toString()
Overloads the default method to call the delegate one. |
Methods inherited from class org.objectweb.jac.core.rtti.MemberItem |
addDependentMethod, equals, getClassItem, getDependentMethods, getMemberFromFullName, getModifiers, getType, getTypeItem, isRole, setRole |
Methods inherited from class org.objectweb.jac.core.rtti.MetaItemDelegate |
getDelegate, getParent, setParent |
Methods inherited from class org.objectweb.jac.core.rtti.MetaItem |
getAttribute, getAttribute, getAttributeAlways, getBoolean, getItemClass, getName, registerAccessController, setAttribute, setItemClass, unsetAttribute, unsetAttributesFor |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AbstractMethodItem(Object delegate, ClassItem parent) throws InvalidDelegateException
delegate
- the java.lang.reflect
actual
meta itemMethod Detail |
public final Object getAttribute(String name)
getAttribute
in class MetaItem
name
- the name of the attribute
public abstract Class[] getParameterTypes()
public void setParameter(Object[] params, int i, Object value)
public Object getParameter(Object[] params, int i)
public ClassItem getParameterTypeItem(int n)
n
- the number of the parameter
public int getParameterCount()
public final boolean isStatic()
public String getFullName()
getCompactFullName()
public String getRealFullName()
getCompactFullName()
public static String getFullName(String name, Class[] pts)
public String getCompactFullName()
getFullName()
public String getLongName()
MemberItem
getLongName
in class MemberItem
public String getTypedName()
public Object invoke(Object object, Object[] parameters)
public AbstractMethodItem getConcreteMethod()
public ClassItem getOwningClass()
public abstract boolean isAdder()
public abstract CollectionItem[] getAddedCollections()
public final CollectionItem getAddedCollection()
public abstract boolean isRemover()
public abstract CollectionItem[] getRemovedCollections()
public abstract boolean isAccessor()
public abstract boolean isWriter()
public abstract boolean isGetter()
public abstract boolean isSetter()
public abstract boolean isCollectionGetter()
public abstract boolean isCollectionAccessor()
public abstract boolean isCollectionSetter()
public abstract boolean isFieldGetter()
public abstract boolean isFieldSetter()
public abstract boolean isReferenceGetter()
public abstract boolean isReferenceSetter()
public abstract boolean isReferenceAccessor()
public abstract FieldItem getSetField()
public final FieldItem[] getWrittenFields()
public final boolean hasWrittenFields()
public final void setWrittenFields(FieldItem[] writtenFields)
writtenFields
- value to assign to writtenFieldsaddWrittenField(FieldItem)
public final void addWrittenField(FieldItem writtenField)
writtenField
- the field to addsetWrittenFields(FieldItem[])
,
removeWrittenField(FieldItem)
public final void removeWrittenField(FieldItem field)
field
- the field to removeaddWrittenField(FieldItem)
public final CollectionItem[] getModifiedCollections()
public final boolean hasModifiedCollections()
public final void addModifiedCollection(CollectionItem modifiedCollection)
modifiedCollection
- the collection to addpublic final FieldItem[] getAccessedFields()
public void setAccessedFields(FieldItem[] accessedFields)
accessedFields
- value to assign to accessedFieldsaddAccessedField(FieldItem)
public void addAccessedField(FieldItem accessedField)
accessedField
- the field to addsetAccessedFields(FieldItem[])
,
removeAccessedField(FieldItem)
public void removeAccessedField(FieldItem field)
field
- the field to removeaddAccessedField(FieldItem)
public final FieldItem[] getAccessedReferences()
public final CollectionItem[] getAccessedCollections()
public final boolean isModifier()
public String toString()
MetaItemDelegate
toString
in class MemberItem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |