jodd.proxetta
Class ProxyTarget

java.lang.Object
  extended by jodd.proxetta.ProxyTarget

public final class ProxyTarget
extends java.lang.Object

Marker class for proxy implementations.


Constructor Summary
ProxyTarget()
           
 
Method Summary
static java.lang.Object argument(int index)
          Inserts value of method argument specified by 1-based index.
static int argumentsCount()
          Inserts total number of method's arguments.
static java.lang.Class argumentType(int index)
          Inserts type of method argument specified by 1-based index.
static java.lang.Object[] createArgumentsArray()
          Creates array of arguments values.
static java.lang.Class[] createArgumentsClassArray()
          Creates array of arguments types.
static java.lang.Object invoke()
          Inserts the invocation of target method and getting the invocation results.
static java.lang.Class returnType()
          Inserts return type of target method.
static void setArgument(java.lang.Object value, int index)
          Assigns new value for an argument specified by 1-based index.
static java.lang.Object target()
          Inserts proxy (i.e. target) instance.
static java.lang.Class targetClass()
          Inserts target class.
static java.lang.String targetMethodName()
          Inserts target method name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyTarget

public ProxyTarget()
Method Detail

invoke

public static java.lang.Object invoke()
Inserts the invocation of target method and getting the invocation results. Small types are converted to wrappers. If method is void, null is used for return value.


argumentsCount

public static int argumentsCount()
Inserts total number of method's arguments.


argumentType

public static java.lang.Class argumentType(int index)
Inserts type of method argument specified by 1-based index. Works correctly with null argument values.

See Also:
createArgumentsClassArray()

argument

public static java.lang.Object argument(int index)
Inserts value of method argument specified by 1-based index.

See Also:
createArgumentsArray()

setArgument

public static void setArgument(java.lang.Object value,
                               int index)
Assigns new value for an argument specified by 1-based index.


createArgumentsArray

public static java.lang.Object[] createArgumentsArray()
Creates array of arguments values. It is more safely then to get one argument at time, since the returned array has correct length. Equals to: new Object[] {arg1, arg2,...}

See Also:
createArgumentsClassArray(), argument(int)

createArgumentsClassArray

public static java.lang.Class[] createArgumentsClassArray()
Creates array of arguments types. Works correctly with null argument values. Equals to: new Class[] {Arg1Type.class, Arg2Type.class...}

See Also:
createArgumentsArray(), argumentType(int)

returnType

public static java.lang.Class returnType()
Inserts return type of target method. null is used for void.


target

public static java.lang.Object target()
Inserts proxy (i.e. target) instance.


targetClass

public static java.lang.Class targetClass()
Inserts target class.


targetMethodName

public static java.lang.String targetMethodName()
Inserts target method name. Useful for reflection.



Copyright ©2008 Jodd Team