JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.core.rtti
Class MetaItem

java.lang.Object
  |
  +--org.objectweb.jac.core.rtti.MetaItem
Direct Known Subclasses:
MetaItemDelegate, VirtualClassItem

public abstract class MetaItem
extends Object

This class defines the super class for all the meta items whithin the rtti aspect.

A meta item encapsulates a java.lang.reflect item so that the user of this item can add extra informations (attributes). Typically this feature can be used by an aspect to tag an element of the model to react to this tag later on.

Examples:

Author:
Renaud Pawlak, Laurent Martelli

Field Summary
protected static HashMap attrACs
          A correspondance table between the RRTI attributes and the aspect components that set them.
 
Constructor Summary
MetaItem()
           
 
Method Summary
 Object getAttribute(Object substance, String name)
          Gets the value of an attribute.
 Object getAttribute(String name)
          Gets the value of an attribute.
 Object getAttribute(String name, boolean always)
          Gets the value of an attribute.
 Object getAttributeAlways(String name)
          Gets the value of an attribute even if the aspect if not yet configured and weaved.
 boolean getBoolean(String name, boolean defValue)
          Gets the value of a boolean attribute.
 MetaItem getItemClass()
           
abstract  String getName()
          This method gets the name of the meta item by delegating to the actual java.lang.reflect meta item.
static void registerAccessController(AttributeController controller)
          Registers a new access controller for this application.
 void setAttribute(String name, Object value)
          Sets the value of an attribute.
 void setItemClass(MetaItem itemClass)
           
 void unsetAttribute(String name)
          Unsets the value of an attribute.
static void unsetAttributesFor(String acName)
          Unsets all the attributes of all the RTTI items that have been set by a given aspect component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attrACs

protected static HashMap attrACs
A correspondance table between the RRTI attributes and the aspect components that set them.

Constructor Detail

MetaItem

public MetaItem()
Method Detail

unsetAttributesFor

public static void unsetAttributesFor(String acName)
Unsets all the attributes of all the RTTI items that have been set by a given aspect component.

Parameters:
acName - the aspect component name
See Also:
unsetAttribute(String)

registerAccessController

public static void registerAccessController(AttributeController controller)
Registers a new access controller for this application.

Parameters:
controller - the controller object

getAttribute

public Object getAttribute(String name)
Gets the value of an attribute.

Parameters:
name - the name of the attribute
Returns:
the value of the attribute

getAttributeAlways

public Object getAttributeAlways(String name)
Gets the value of an attribute even if the aspect if not yet configured and weaved.

Parameters:
name - the name of the attribute
Returns:
the value of the attribute

getAttribute

public Object getAttribute(String name,
                           boolean always)
Gets the value of an attribute.

Parameters:
name - the name of the attribute
always - if true, return a value even the aspect is not weaved
Returns:
the value of the attribute

getBoolean

public boolean getBoolean(String name,
                          boolean defValue)
Gets the value of a boolean attribute.

Parameters:
name - the name of the attribute
defValue - default value for the attribute if it is not set
Returns:
the value of the attribute

getAttribute

public Object getAttribute(Object substance,
                           String name)
Gets the value of an attribute.

Parameters:
substance -
name - the name of the attribute
Returns:
the value of the attribute

setAttribute

public final void setAttribute(String name,
                               Object value)
Sets the value of an attribute.

Parameters:
name - the name of the attribute
value - the value of the attribute

unsetAttribute

public void unsetAttribute(String name)
Unsets the value of an attribute.

Parameters:
name - the name of the attribute

getName

public abstract String getName()
This method gets the name of the meta item by delegating to the actual java.lang.reflect meta item.

Returns:
the item name

setItemClass

public void setItemClass(MetaItem itemClass)

getItemClass

public MetaItem getItemClass()

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli