# ScriptParameter

Import: `import com.install4j.api.beaninfo.ScriptParameter;`

```java
public class ScriptParameter
```

Descriptor for script parameters of script properties defined with a [`ScriptPropertyDescriptor`](ScriptPropertyDescriptor.md).


**See also:**

- [ScriptProperty](../beans/ScriptProperty.md)

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getParameterName()`](#getparametername) | `String` | Get the parameter name |
| [`getParameterClass()`](#getparameterclass) | `Class` | Get the parameter class. |
| [`getParameterType()`](#getparametertype) | `Type` | Get the parameter type |

### getParameterName()

```java
public String getParameterName()
```

Get the parameter name


**Returns:** the name

### getParameterClass()

```java
public 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()

```java
public Type getParameterType()
```

Get the parameter type


**Returns:** the type

## Constructors

| Signature | Description |
|---|---|
| [`ScriptParameter(String, Class)`](#scriptparameter-string-class) | Create a script parameter. |
| [`ScriptParameter(String, ParameterizedType)`](#scriptparameter-string-parameterizedtype) | Create a script parameter with a generic type. |

### ScriptParameter(String, Class)

```java
public ScriptParameter(String parameterName, Class parameterClass)
```

Create a script parameter.


**Parameters:**

- `parameterName` — the parameter name
- `parameterClass` — the parameter class

### ScriptParameter(String, ParameterizedType)

```java
public ScriptParameter(String parameterName, 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&lt;String&gt;`, you
define a helper interface

```
  private interface StringList extends List&lt;String[]&gt; {}
```

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

