org.codehaus.aspectwerkz.transform
Class Context

java.lang.Object
  extended byorg.codehaus.aspectwerkz.transform.Context

public class Context
extends java.lang.Object

Transformation context.

Author:
Jonas Bonér

Constructor Summary
Context(java.lang.ClassLoader loader)
          Creates a new context.
 
Method Summary
 void addMetaData(java.lang.Object key, java.lang.Object value)
          Adds new meta-data for the transformation.
 org.apache.bcel.classfile.JavaClass getJavaClass(org.apache.bcel.generic.ClassGen cg)
          Returns the JavaClass corresponding to the ClassGen.
 java.lang.ClassLoader getLoader()
          Returns the class loader.
 java.lang.Object getMetaData(java.lang.Object key)
          Returns meta-data for the transformation.
 java.util.Map getMetaDataRepository()
          Returns the meta-data repository.
 org.apache.bcel.util.Repository getRepository()
          Returns the repository.
 org.apache.bcel.classfile.JavaClass getSuperClass(org.apache.bcel.generic.ClassGen cg)
          Returns the super class a the JavaClass.
 boolean isAdvised()
          Checks if the class being transformed has beed advised.
 boolean isReadOnly()
          Checks if the context is read-only.
 void markAsAdvised()
          Marks the class being transformed as advised.
 void markAsReadOnly()
          Marks the context as read-only.
 void setMetaDataRepository(java.util.Map repository)
          Sets the meta-data repository.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context(java.lang.ClassLoader loader)
Creates a new context.

Parameters:
loader - the class loader
Method Detail

getLoader

public java.lang.ClassLoader getLoader()
Returns the class loader.

Returns:
the class loader

getRepository

public org.apache.bcel.util.Repository getRepository()
Returns the repository.

Returns:
the BCEL Repository based on context class loader

getMetaDataRepository

public java.util.Map getMetaDataRepository()
Returns the meta-data repository.

Returns:
the meta-data repository

setMetaDataRepository

public void setMetaDataRepository(java.util.Map repository)
Sets the meta-data repository.


markAsAdvised

public void markAsAdvised()
Marks the class being transformed as advised. The marker can at most be set once per class per transformer


isAdvised

public boolean isAdvised()
Checks if the class being transformed has beed advised.

Returns:
boolean

markAsReadOnly

public void markAsReadOnly()
Marks the context as read-only.


isReadOnly

public boolean isReadOnly()
Checks if the context is read-only.

Returns:
boolean

getMetaData

public java.lang.Object getMetaData(java.lang.Object key)
Returns meta-data for the transformation.

Parameters:
key - the key
Returns:
the value

addMetaData

public void addMetaData(java.lang.Object key,
                        java.lang.Object value)
Adds new meta-data for the transformation.

Parameters:
key - the key
value - the value

getJavaClass

public org.apache.bcel.classfile.JavaClass getJavaClass(org.apache.bcel.generic.ClassGen cg)
Returns the JavaClass corresponding to the ClassGen. Set its repository based on the context class loader.

Parameters:
cg - the ClassGen
Returns:
JavaClass

getSuperClass

public org.apache.bcel.classfile.JavaClass getSuperClass(org.apache.bcel.generic.ClassGen cg)
Returns the super class a the JavaClass. Set its repository based on the context class loader.

Parameters:
cg - the ClassGen
Returns:
the super class of the JavaClass


Copyright (c) 2002-2004 The AspectWerkz Team. All Rights Reserved.