Package com.install4j.api.beaninfo
Class ScriptParameter
java.lang.Object
com.install4j.api.beaninfo.ScriptParameter
Descriptor for script parameters of script properties defined with a
ScriptPropertyDescriptor
.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionScriptParameter
(String parameterName, Class parameterClass) Create a script parameter.ScriptParameter
(String parameterName, ParameterizedType parameterizedType) Create a script parameter with a generic type. -
Method Summary
Modifier and TypeMethodDescriptionGet the parameter class.Get the parameter nameGet the parameter type
-
Constructor Details
-
ScriptParameter
Create a script parameter.- Parameters:
parameterName
- the parameter nameparameterClass
- the parameter class
-
ScriptParameter
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 Details
-
getParameterName
Get the parameter name- Returns:
- the name
-
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
Get the parameter type- Returns:
- the type
-