Class ScriptParameter

    • Constructor Summary

      Constructors 
      Constructor Description
      ScriptParameter​(java.lang.String parameterName, java.lang.Class parameterClass)
      Create a script parameter.
      ScriptParameter​(java.lang.String parameterName, java.lang.reflect.ParameterizedType parameterizedType)
      Create a script parameter with a generic type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class getParameterClass()
      Get the parameter class.
      java.lang.String getParameterName()
      Get the parameter name
      java.lang.reflect.Type getParameterType()
      Get the parameter type
      • Methods inherited from class java.lang.Object

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

      • ScriptParameter

        public ScriptParameter​(java.lang.String parameterName,
                               java.lang.Class parameterClass)
        Create a script parameter.
        Parameters:
        parameterName - the parameter name
        parameterClass - the parameter class
      • ScriptParameter

        public ScriptParameter​(java.lang.String parameterName,
                               java.lang.reflect.ParameterizedType parameterizedType)
        Create a script parameter with a generic type. Getting a concrete generic type requires some work, for example to get a type for List<String>, you define a helper interface
        
           private interface StringList extends List<String[]> {}
         
        and query the generic super-interface to get the desired generic type:
        
           (ParameterizedType)StringArrayList.class.getGenericInterfaces()[0]
         
        Parameters:
        parameterName - the parameter name
        parameterizedType - the parameter type
    • Method Detail

      • getParameterName

        public java.lang.String getParameterName()
        Get the parameter name
        Returns:
        the name
      • getParameterClass

        public java.lang.Class getParameterClass()
        Get the parameter class. If the script parameter has been created with a parameterized type, this returns the raw type.
        Returns:
        the class
      • getParameterType

        public java.lang.reflect.Type getParameterType()
        Get the parameter type
        Returns:
        the type