Package org.aopalliance.reflect
Interface ProgramUnit
-
public interface ProgramUnit
An abstract program unit.Any structural unit of a base program (class, member, ...). Units exclude the code.
When referencing a program unit, the client can retrieve unit locators using
getLocator()
or more specific methods. This locators shall be used conjointly whith anInstrumentor
implementation in order to perform aspetual transformations of the program (e.g. type merging, parameters adding,...).Program units also supports metadatas, i.e. the ability to add extra information on the base program so that the client can extends its meaning very easily.
- See Also:
Instrumentor
,UnitLocator
,Class
,Method
,Field
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMetadata(Metadata metadata)
Associates a metadata to the current unit.UnitLocator
getLocator()
Returns the locator that corresponds to this unit.Metadata
getMetadata(java.lang.Object key)
Returns the metadata that is associated to this unit from its key.Metadata[]
getMetadatas()
Returns all the metadatas that are associated to the current unit.void
removeMetadata(java.lang.Object key)
Removes a metadata from its key.
-
-
-
Method Detail
-
getLocator
UnitLocator getLocator()
Returns the locator that corresponds to this unit.
-
getMetadata
Metadata getMetadata(java.lang.Object key)
Returns the metadata that is associated to this unit from its key.
-
getMetadatas
Metadata[] getMetadatas()
Returns all the metadatas that are associated to the current unit.
-
addMetadata
void addMetadata(Metadata metadata)
Associates a metadata to the current unit.If a metadata already exists with the same key, then its value is replaced by the newly given one.
-
removeMetadata
void removeMetadata(java.lang.Object key)
Removes a metadata from its key.If none metadata having the given key exists, then this method has no effect.
-
-