org.objectweb.jac.core.rtti
Class MemberItem

java.lang.Object
  extended byorg.objectweb.jac.core.rtti.MetaItem
      extended byorg.objectweb.jac.core.rtti.MetaItemDelegate
          extended byorg.objectweb.jac.core.rtti.MemberItem
Direct Known Subclasses:
AbstractMethodItem, FieldItem

public abstract class MemberItem
extends MetaItemDelegate

This class defines a meta item that corresponds to a field or a method.

Author:
Renaud Pawlak, Laurent Martelli

Field Summary
protected  boolean role
           
protected  ClassItem roleClassType
           
protected  String roleName
           
protected  String 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
MemberItem(ClassItem parent)
           
MemberItem(Object delegate, ClassItem parent)
           
 
Method Summary
 void addDependentMethod(MethodItem method)
           
 boolean equals(Object o)
          Two members are equal if the class of one is a subclass of the other's class and they have the same name
 ClassItem getClassItem()
          Returns the class item that owns the field (like getParent).
 MethodItem[] getDependentMethods()
          Returns an array of methods whose result depend on the member.
 String getLongName()
          Returns the name prfixed with the owning class name.
static MemberItem getMemberFromFullName(String str)
          A util method to get a member item reference from a full name.
 int getModifiers()
          Get the modifiers (see java.lang.reflect) of the meta item.
abstract  Class getType()
          This method gets the type of the meta item by delegating to the actual java.lang.reflect meta item.
 ClassItem getTypeItem()
           
 boolean isRole()
          Tells if this field is actually implemented by a role wrapper field.
 void setRole(ClassItem roleClassType, String roleType, String roleName)
          Sets this field to be actually implemented by a field of a role wrapper.
 String toString()
          Overloads the default method to call the delegate one.
 
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, 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
 

Field Detail

role

protected boolean role

roleClassType

protected ClassItem roleClassType

roleType

protected String roleType

roleName

protected String roleName
Constructor Detail

MemberItem

public MemberItem(ClassItem parent)

MemberItem

public MemberItem(Object delegate,
                  ClassItem parent)
           throws InvalidDelegateException
Method Detail

getMemberFromFullName

public static MemberItem getMemberFromFullName(String str)
                                        throws Exception
A util method to get a member item reference from a full name.

Parameters:
str - member's full name, E.g.: myPackage.Person.name.
Throws:
Exception

getType

public abstract Class getType()
Description copied from class: MetaItemDelegate
This method gets the type of the meta item by delegating to the actual java.lang.reflect meta item.

Specified by:
getType in class MetaItemDelegate
Returns:
the item type

getTypeItem

public final ClassItem getTypeItem()

getClassItem

public final ClassItem getClassItem()
Returns the class item that owns the field (like getParent).


addDependentMethod

public final void addDependentMethod(MethodItem method)
See Also:
getDependentMethods()

getDependentMethods

public final MethodItem[] getDependentMethods()
Returns an array of methods whose result depend on the member.

See Also:
addDependentMethod(MethodItem)

isRole

public boolean isRole()
Tells if this field is actually implemented by a role wrapper field.

Returns:
value of role
See Also:
setRole(ClassItem,String,String)

setRole

public void setRole(ClassItem roleClassType,
                    String roleType,
                    String roleName)
Sets this field to be actually implemented by a field of a role wrapper.

When this method is called once, the isRole() method will return true. Moreover, the actually accessed and modified field when using set, get, etc, is the field of the role wrapper.


getLongName

public String getLongName()
Returns the name prfixed with the owning class name.


getModifiers

public int getModifiers()
Description copied from class: MetaItemDelegate
Get the modifiers (see java.lang.reflect) of the meta item.

Overrides:
getModifiers in class MetaItemDelegate
Returns:
an int representing the modifiers
See Also:
Modifier

toString

public String toString()
Description copied from class: MetaItemDelegate
Overloads the default method to call the delegate one.

Overrides:
toString in class MetaItemDelegate
Returns:
a textual representation of the object

equals

public boolean equals(Object o)
Two members are equal if the class of one is a subclass of the other's class and they have the same name