org.codehaus.groovy.reflection
Class ParameterTypes

java.lang.Object
  extended by org.codehaus.groovy.reflection.ParameterTypes
Direct Known Subclasses:
CachedConstructor, MetaMethod

public class ParameterTypes
extends java.lang.Object


Field Summary
protected  boolean isVargsMethod
           
protected  java.lang.Class[] nativeParamTypes
           
protected  CachedClass[] parameterTypes
           
 
Constructor Summary
ParameterTypes()
           
ParameterTypes(CachedClass[] parameterTypes)
           
ParameterTypes(java.lang.Class[] pt)
           
ParameterTypes(java.lang.String[] pt)
           
 
Method Summary
 java.lang.Object[] coerceArgumentsToClasses(java.lang.Object[] argumentArray)
           
 java.lang.Object[] correctArguments(java.lang.Object[] argumentArray)
           
private static java.lang.Object[] fitToVargs(java.lang.Object[] argumentArray, CachedClass[] paramTypes)
          this method is called when the number of arguments to a method is greater than 1 and if the method is a vargs method.
private  java.lang.Class getArgClass(java.lang.Object arg)
           
 java.lang.Class[] getNativeParameterTypes()
           
private  void getNativeParameterTypes0()
           
private  void getParametersTypes0()
           
 CachedClass[] getParameterTypes()
           
protected  java.lang.Class[] getPT()
           
 boolean isValidExactMethod(java.lang.Class[] args)
           
private  boolean isValidExactMethod(java.lang.Class[] arguments, CachedClass[] pt)
           
 boolean isValidExactMethod(java.lang.Object[] args)
           
 boolean isValidMethod(java.lang.Class[] arguments)
           
 boolean isValidMethod(java.lang.Object[] arguments)
           
private  boolean isValidVarargsMethod(java.lang.Class[] arguments, int size, CachedClass[] pt, int paramMinus1)
           
 boolean isVargsMethod(java.lang.Object[] arguments)
           
protected  void setParametersTypes(CachedClass[] pt)
           
private static boolean testComponentAssignable(java.lang.Class toTestAgainst, java.lang.Class toTest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nativeParamTypes

protected volatile java.lang.Class[] nativeParamTypes

parameterTypes

protected volatile CachedClass[] parameterTypes

isVargsMethod

protected boolean isVargsMethod
Constructor Detail

ParameterTypes

public ParameterTypes()

ParameterTypes

public ParameterTypes(java.lang.Class[] pt)

ParameterTypes

public ParameterTypes(java.lang.String[] pt)

ParameterTypes

public ParameterTypes(CachedClass[] parameterTypes)
Method Detail

setParametersTypes

protected final void setParametersTypes(CachedClass[] pt)

getParameterTypes

public CachedClass[] getParameterTypes()

getParametersTypes0

private void getParametersTypes0()

getNativeParameterTypes

public java.lang.Class[] getNativeParameterTypes()

getNativeParameterTypes0

private void getNativeParameterTypes0()

getPT

protected java.lang.Class[] getPT()

isVargsMethod

public boolean isVargsMethod(java.lang.Object[] arguments)

coerceArgumentsToClasses

public final java.lang.Object[] coerceArgumentsToClasses(java.lang.Object[] argumentArray)

correctArguments

public java.lang.Object[] correctArguments(java.lang.Object[] argumentArray)

fitToVargs

private static java.lang.Object[] fitToVargs(java.lang.Object[] argumentArray,
                                             CachedClass[] paramTypes)
this method is called when the number of arguments to a method is greater than 1 and if the method is a vargs method. This method will then transform the given arguments to make the method callable

Parameters:
argumentArray - the arguments used to call the method
paramTypes - the types of the paramters the method takes

isValidMethod

public boolean isValidMethod(java.lang.Class[] arguments)

isValidExactMethod

private boolean isValidExactMethod(java.lang.Class[] arguments,
                                   CachedClass[] pt)

isValidExactMethod

public boolean isValidExactMethod(java.lang.Object[] args)

isValidExactMethod

public boolean isValidExactMethod(java.lang.Class[] args)

testComponentAssignable

private static final boolean testComponentAssignable(java.lang.Class toTestAgainst,
                                                     java.lang.Class toTest)

isValidVarargsMethod

private boolean isValidVarargsMethod(java.lang.Class[] arguments,
                                     int size,
                                     CachedClass[] pt,
                                     int paramMinus1)

isValidMethod

public boolean isValidMethod(java.lang.Object[] arguments)

getArgClass

private java.lang.Class getArgClass(java.lang.Object arg)


Copyright © ${year} The Codehaus. All Rights Reserved.