org.codehaus.aspectwerkz.joinpoint.impl
Class MethodRttiImpl

java.lang.Object
  extended by org.codehaus.aspectwerkz.joinpoint.impl.MethodRttiImpl
All Implemented Interfaces:
CodeRtti, MemberRtti, MethodRtti, Rtti

public class MethodRttiImpl
extends Object
implements MethodRtti

Implementation for the method signature.

Author:
Jonas BonŽr

Constructor Summary
MethodRttiImpl(MethodSignatureImpl signature, Object thisInstance, Object targetInstance)
          Creates a new method RTTI.
 
Method Summary
 Rtti cloneFor(Object thisInstance, Object targetInstance)
          Clones the RTTI instance.
 Class getDeclaringType()
          Returns the declaring class.
 Class[] getExceptionTypes()
          Returns the exception types declared by the code block.
 Method getMethod()
          Returns the method.
 int getModifiers()
          Returns the modifiers for the signature.
 String getName()
          Returns the name (f.e. name of method of field).
 Class[] getParameterTypes()
          Returns the parameter types.
 Object[] getParameterValues()
          Returns the values of the parameters.
 Class getReturnType()
          Returns the return type.
 Object getReturnValue()
          Returns the value of the return type.
 Object getTarget()
          Returns the target instance.
 Object getThis()
          Returns the instance currently executing.
 void setParameterValues(Object[] parameterValues)
          Sets the values of the parameters.
 void setReturnValue(Object returnValue)
          Sets the return value.
 String toString()
          Returns a string representation of the signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodRttiImpl

public MethodRttiImpl(MethodSignatureImpl signature,
                      Object thisInstance,
                      Object targetInstance)
Creates a new method RTTI.

Parameters:
signature -
thisInstance -
targetInstance -
Method Detail

cloneFor

public Rtti cloneFor(Object thisInstance,
                     Object targetInstance)
Clones the RTTI instance.

Specified by:
cloneFor in interface Rtti
Parameters:
thisInstance -
targetInstance -
Returns:

getTarget

public Object getTarget()
Returns the target instance.

Specified by:
getTarget in interface Rtti
Returns:
the target instance

getThis

public Object getThis()
Returns the instance currently executing.

Specified by:
getThis in interface Rtti
Returns:
the instance currently executing

getMethod

public Method getMethod()
Returns the method.

Specified by:
getMethod in interface MethodRtti
Returns:
the method

getDeclaringType

public Class getDeclaringType()
Returns the declaring class.

Specified by:
getDeclaringType in interface Rtti
Returns:
the declaring class

getModifiers

public int getModifiers()
Returns the modifiers for the signature.

Could be used like this:

 boolean isPublic = java.lang.reflect.Modifier.isPublic(signature.getModifiers());
 

Specified by:
getModifiers in interface Rtti
Returns:
the mofifiers

getName

public String getName()
Returns the name (f.e. name of method of field).

Specified by:
getName in interface Rtti
Returns:

getExceptionTypes

public Class[] getExceptionTypes()
Returns the exception types declared by the code block.

Specified by:
getExceptionTypes in interface CodeRtti
Returns:
the exception types

getParameterTypes

public Class[] getParameterTypes()
Returns the parameter types.

Specified by:
getParameterTypes in interface CodeRtti
Returns:
the parameter types

setParameterValues

public void setParameterValues(Object[] parameterValues)
Sets the values of the parameters.

Specified by:
setParameterValues in interface CodeRtti
Parameters:
parameterValues -

getParameterValues

public Object[] getParameterValues()
Returns the values of the parameters.

Specified by:
getParameterValues in interface CodeRtti
Returns:
the values of the parameters

getReturnType

public Class getReturnType()
Returns the return type.

Specified by:
getReturnType in interface MethodRtti
Returns:
the return type

setReturnValue

public void setReturnValue(Object returnValue)
Sets the return value.

Parameters:
returnValue - the return value

getReturnValue

public Object getReturnValue()
Returns the value of the return type.

Specified by:
getReturnValue in interface MethodRtti
Returns:
the value of the return type

toString

public String toString()
Returns a string representation of the signature.

Overrides:
toString in class Object
Returns:
a string representation


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