Package com.install4j.api.beaninfo
Class ScriptParameter
- java.lang.Object
-
- com.install4j.api.beaninfo.ScriptParameter
-
public class ScriptParameter extends java.lang.ObjectDescriptor for script parameters of script properties defined with aScriptPropertyDescriptor.- See Also:
ScriptProperty
-
-
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.ClassgetParameterClass()Get the parameter class.java.lang.StringgetParameterName()Get the parameter namejava.lang.reflect.TypegetParameterType()Get the parameter type
-
-
-
Constructor Detail
-
ScriptParameter
public ScriptParameter(java.lang.String parameterName, java.lang.Class parameterClass)Create a script parameter.- Parameters:
parameterName- the parameter nameparameterClass- 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 forList<String>, you define a helper interface
and query the generic super-interface to get the desired generic type:private interface StringList extends List<String[]> {}(ParameterizedType)StringArrayList.class.getGenericInterfaces()[0]- Parameters:
parameterName- the parameter nameparameterizedType- 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
-
-