Class ConstructorFunction

  • All Implemented Interfaces:
    Function

    public class ConstructorFunction
    extends java.lang.Object
    implements Function
    An extension function that creates an instance using a constructor.
    Version:
    $Revision: 652845 $ $Date: 2008-05-02 12:46:46 -0500 (Fri, 02 May 2008) $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.reflect.Constructor constructor  
      private static java.lang.Object[] EMPTY_ARRAY  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstructorFunction​(java.lang.reflect.Constructor constructor)
      Create a new ConstructorFunction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object invoke​(ExpressionContext context, java.lang.Object[] parameters)
      Converts parameters to suitable types and invokes the constructor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EMPTY_ARRAY

        private static final java.lang.Object[] EMPTY_ARRAY
      • constructor

        private java.lang.reflect.Constructor constructor
    • Constructor Detail

      • ConstructorFunction

        public ConstructorFunction​(java.lang.reflect.Constructor constructor)
        Create a new ConstructorFunction.
        Parameters:
        constructor - the constructor to call.
    • Method Detail

      • invoke

        public java.lang.Object invoke​(ExpressionContext context,
                                       java.lang.Object[] parameters)
        Converts parameters to suitable types and invokes the constructor.
        Specified by:
        invoke in interface Function
        Parameters:
        context - evaluation context
        parameters - constructor args
        Returns:
        new instance