alt.jiapi.interceptor
Interface AccessAdvisor


public interface AccessAdvisor

AccessAdvisor provides methods that are called when instrumented class is accessing some field. It is possible to change access behaviour by returning a different value to calling method(Jiapi runtime).

Minimum viable implementation ensuring correct functionality is

       public Object set(Object target, String fieldName, Object value) {
           return value;
       }
       public Object get(Object target, String fieldName, Object value) {
           return value;
       }
 

Author:
Mika Riekkinen

Method Summary
 java.lang.Object get(java.lang.Object target, java.lang.String fieldName, java.lang.Object value)
          This method is called, when a field has been get.
 java.lang.Object set(java.lang.Object target, java.lang.String fieldName, java.lang.Object value)
          This method is called, when a field is being set.
 

Method Detail

get

java.lang.Object get(java.lang.Object target,
                     java.lang.String fieldName,
                     java.lang.Object value)
This method is called, when a field has been get. It must be noted, that this method will not change the value of the target field.

Parameters:
target - target Object or target Class, if the field is static
fieldName - name of the field
value - value of the field. If the field holds a primitive type, value is wrapped to corresponding primitive wrapper, like java.lang.Integer
Returns:
a new value to get

set

java.lang.Object set(java.lang.Object target,
                     java.lang.String fieldName,
                     java.lang.Object value)
This method is called, when a field is being set.

Parameters:
target - target Object or target Class, if the field is static
fieldName - name of the field
value - value to set. If the field holds a primitive type, value is wrapped to corresponding primitive wrapper, like java.lang.Integer
Returns:
a new value to set


Copyright © 2001. Documenation generated August 26 2011.