info.javelot.functionalj.reflect.element
Class ReflectJdkStaticMethod

java.lang.Object
  extended by info.javelot.functionalj.reflect.element.ReflectJdkStaticMethod
All Implemented Interfaces:
ReflectElement
Direct Known Subclasses:
ReflectCglibStaticMethod

public class ReflectJdkStaticMethod
extends Object
implements ReflectElement

Represents a reflect JDK static method.

Author:
Copyright © 2006 Frederic Daoud

Constructor Summary
ReflectJdkStaticMethod(Method p_method)
          Constructs a reflect element for a static method.
 
Method Summary
 String getName()
          Returns the name of the reflect element.
 Class[] getParameterTypes()
          Returns the types of the parameters to the reflect element.
 Object invoke(Object[] p_params)
          Invokes the target static method, passing the parameters to the method.
 String toString()
          String representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReflectJdkStaticMethod

public ReflectJdkStaticMethod(Method p_method)
Constructs a reflect element for a static method.

Parameters:
p_method - the method to be invoked.
Method Detail

getName

public String getName()
Description copied from interface: ReflectElement
Returns the name of the reflect element. For a constructor, this is the name of the class. For a method, this is the name of the class and the name of the method.

Specified by:
getName in interface ReflectElement

getParameterTypes

public Class[] getParameterTypes()
Description copied from interface: ReflectElement
Returns the types of the parameters to the reflect element.

Specified by:
getParameterTypes in interface ReflectElement
Returns:
the types of the parameters to the reflect element.

invoke

public Object invoke(Object[] p_params)
              throws Exception
Invokes the target static method, passing the parameters to the method.

Specified by:
invoke in interface ReflectElement
Parameters:
p_params - the parameters to be passed to the method.
Returns:
the result of invoking the method.
Throws:
Exception - thrown if an exception occurs when invoking the method.

toString

public String toString()
String representation.

Overrides:
toString in class Object