info.javelot.functionalj.reflect.element
Class ReflectJdkConstructor

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

public class ReflectJdkConstructor
extends Object
implements ReflectElement

Represents a reflect JDK constructor.

Author:
Copyright © 2006 Frederic Daoud

Constructor Summary
ReflectJdkConstructor(Constructor p_constr)
          Constructs a reflect element for a JDK constructor.
 
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 constructor, passing the specified parameters.
 String toString()
          String representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReflectJdkConstructor

public ReflectJdkConstructor(Constructor p_constr)
Constructs a reflect element for a JDK constructor.

Parameters:
p_constr - the reflect constructor.
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 constructor, passing the specified parameters.

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

toString

public String toString()
String representation.

Overrides:
toString in class Object