# ScriptPropertyDescriptor

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

```java
public class ScriptPropertyDescriptor extends Install4JPropertyDescriptor
```

Property descriptor for properties of type [`ScriptProperty`](../beans/ScriptProperty.md).
With this descriptor you define the return type and the parameters that are passed to the script by
[`Context.runScript`](../context/Context.md#runscript-scriptproperty-bean-object)
at runtime.

Using this class is not strictly required. In principle, you could also set values for the `ATTRIBUTE_*` constants in the property descriptor
of an unrelated property descriptor class.


**See also:**

- [ScriptParameter](ScriptParameter.md)

## Inherited from

- [Install4JPropertyDescriptor](Install4JPropertyDescriptor.md) — 23 methods, 35 fields

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`create(String, Class, String, String, Class, ScriptParameter[])`](#create-string-class-string-string-class-scriptparameter) | `ScriptPropertyDescriptor` | Create a script property descriptor as with [`Install4JPropertyDescriptor.create`](Install4JPropertyDescriptor.md#create-string-class-string-string) and additional configuration specific to script properties. |
| [`setCodeGalleryTags(String[])`](#setcodegallerytags-string) | `ScriptPropertyDescriptor` | Sets the code gallery tags that are used to build the code gallery for this script property. |

### create(String, Class, String, String, Class, ScriptParameter[])

```java
public static ScriptPropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, Class returnType, ScriptParameter[] scriptParameters)
```

Create a script property descriptor as with [`Install4JPropertyDescriptor.create`](Install4JPropertyDescriptor.md#create-string-class-string-string)
and additional configuration specific to script properties.


**Parameters:**

- `returnType` — the class of the return type. Classes for primitive types are written as `void.class` or `int.class`.
- `scriptParameters` — the additional parameters for the script or `null` if no additional parameters are passed.

**Returns:** the property descriptor

**See also:**

- [ScriptProperty](../beans/ScriptProperty.md)
- [Context.runScript](../context/Context.md#runscript-scriptproperty-bean-object)

### setCodeGalleryTags(String[])

```java
public ScriptPropertyDescriptor setCodeGalleryTags(String[] tags)
```

Sets the code gallery tags that are used to build the code gallery for this script property.
This is only relevant if you supply your own code gallery by including a code gallery file (see
`$INSTALL4J_HOME/resource/codeGallery.dtd`) in the extension manifest (attribute `Code-Gallery: true`)


**Parameters:**

- `tags` — the additional tags that should be included in the code gallery

**Returns:** `this`, for chained calls on this property descriptor

## Fields

| Field | Type | Description |
|---|---|---|
| [ATTRIBUTE_RETURN_TYPE](#attribute-return-type) | `String` |  |
| [ATTRIBUTE_SCRIPT_PARAMETERS](#attribute-script-parameters) | `String` |  |
| [ATTRIBUTE_CODE_GALLERY_TAGS](#attribute-code-gallery-tags) | `String` |  |

### ATTRIBUTE_RETURN_TYPE

```java
public static final String ATTRIBUTE_RETURN_TYPE = "returnType"
```

### ATTRIBUTE_SCRIPT_PARAMETERS

```java
public static final String ATTRIBUTE_SCRIPT_PARAMETERS = "scriptParameters"
```

### ATTRIBUTE_CODE_GALLERY_TAGS

```java
public static final String ATTRIBUTE_CODE_GALLERY_TAGS = "codeGalleryTags"
```

