org.codehaus.aspectwerkz.transform
Interface Context

All Known Implementing Classes:
ContextImpl

public interface Context

Interface for the different transformation context implementations. FIXME crap: abstract method on an interface. Refactor some in between if we are sure to keep the delegation model

Author:
Jonas BonŽr

Method Summary
 void addMetaData(Object key, Object value)
          Adds new meta-data for the transformation.
 void dump(String dir)
          Dump the class to specific directory.
 String getClassName()
           
 byte[] getCurrentBytecode()
          Returns the current bytecode.
 Set getDefinitions()
          The definitions context (with hierarchical structure)
 byte[] getInitialBytecode()
          Returns the initial bytecode.
 ClassLoader getLoader()
          Returns the class loader.
 Object getMetaData(Object key)
          Returns meta-data for the transformation.
 boolean isAdvised()
          Checks if the class being transformed has been 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 resetAdvised()
          Resets the isAdviced flag.
 int resolveLineNumberInfo(org.objectweb.asm.Label label)
          Tries to resolve the line number from the given label
 void setCurrentBytecode(byte[] bytecode)
          Sets the current bytecode.
 

Method Detail

getClassName

String getClassName()

setCurrentBytecode

void setCurrentBytecode(byte[] bytecode)
Sets the current bytecode.

Parameters:
bytecode -

getInitialBytecode

byte[] getInitialBytecode()
Returns the initial bytecode.

Returns:
bytecode

getCurrentBytecode

byte[] getCurrentBytecode()
Returns the current bytecode.

Returns:
bytecode

getLoader

ClassLoader getLoader()
Returns the class loader.

Returns:
the class loader

getDefinitions

Set getDefinitions()
The definitions context (with hierarchical structure)

Returns:

markAsAdvised

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


resetAdvised

void resetAdvised()
Resets the isAdviced flag.


isAdvised

boolean isAdvised()
Checks if the class being transformed has been advised. This should only be used after ALL actual transformations.

Returns:
boolean

markAsReadOnly

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


isReadOnly

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

Returns:
boolean

getMetaData

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

Parameters:
key - the key
Returns:
the value

addMetaData

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

Parameters:
key - the key
value - the value

dump

void dump(String dir)
Dump the class to specific directory.

Parameters:
dir -

resolveLineNumberInfo

int resolveLineNumberInfo(org.objectweb.asm.Label label)
Tries to resolve the line number from the given label

Parameters:
label -
Returns:


Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.