org.codehaus.groovy.runtime
Class NewInstanceMetaMethod

java.lang.Object
  extended bygroovy.lang.MetaMethod
      extended byorg.codehaus.groovy.runtime.NewInstanceMetaMethod
All Implemented Interfaces:
java.lang.Cloneable

public class NewInstanceMetaMethod
extends MetaMethod

A MetaMethod implementation where the underlying method is really a static helper method on some class but it appears to be an instance method on a class. This implementation is used to add new methods to the JDK writing them as normal static methods with the first parameter being the class on which the method is added.

Version:
$Revision: 1.1 $
Author:
James Strachan

Field Summary
private static java.lang.Class[] EMPTY_TYPE_ARRAY
           
private  java.lang.Class[] logicalParameterTypes
           
private  MetaMethod metaMethod
           
 
Fields inherited from class groovy.lang.MetaMethod
 
Constructor Summary
NewInstanceMetaMethod(MetaMethod metaMethod)
           
 
Method Summary
 java.lang.Class[] getBytecodeParameterTypes()
           
 java.lang.Class getDeclaringClass()
           
 int getModifiers()
           
 java.lang.Class[] getParameterTypes()
           
 java.lang.Object invoke(java.lang.Object object, java.lang.Object[] arguments)
           
 boolean isStatic()
           
 
Methods inherited from class groovy.lang.MetaMethod
checkParameters, clone, compatibleModifiers, equal, getInterfaceClass, getMethodIndex, getName, getReflector, getReturnType, isCacheable, isMethod, isPrivate, isProtected, isPublic, isSame, setInterfaceClass, setMethodIndex, setReflector, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_TYPE_ARRAY

private static final java.lang.Class[] EMPTY_TYPE_ARRAY

metaMethod

private MetaMethod metaMethod

logicalParameterTypes

private java.lang.Class[] logicalParameterTypes
Constructor Detail

NewInstanceMetaMethod

public NewInstanceMetaMethod(MetaMethod metaMethod)
Method Detail

getDeclaringClass

public java.lang.Class getDeclaringClass()
Overrides:
getDeclaringClass in class MetaMethod

isStatic

public boolean isStatic()
Overrides:
isStatic in class MetaMethod

getModifiers

public int getModifiers()
Overrides:
getModifiers in class MetaMethod

getParameterTypes

public java.lang.Class[] getParameterTypes()
Overrides:
getParameterTypes in class MetaMethod

getBytecodeParameterTypes

public java.lang.Class[] getBytecodeParameterTypes()

invoke

public java.lang.Object invoke(java.lang.Object object,
                               java.lang.Object[] arguments)
                        throws java.lang.Exception
Overrides:
invoke in class MetaMethod
Throws:
java.lang.Exception


Copyright © 2003-2005 The Codehaus. All Rights Reserved.