# ActionValidator

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

```java
interface ActionValidator
```

Validates actions if the validation depends on a containing [`ActionList`](../beans/ActionList.md) property.
The implementing class is stored in the  [`ActionBeanInfo.ATTRIBUTE_ACTION_VALIDATOR`](ActionBeanInfo.md#attribute-action-validator) value of an
action bean descriptor.

With an action validator, you can check at design-time if the values of the bean properties are valid
and notify the user if this is not the case. This only differs from a [`BeanValidator`](BeanValidator.md) in that you are
also supplied with a list of action keys that were configured for an [`ActionList`](../beans/ActionList.md) property that contains
the validated action.


**See also:**

- [BeanValidator](BeanValidator.md)

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`validateAction(Action, List<String>)`](#validateaction-action-list-string) | `void` | Called by the install4j GUI at design-time to check the validity of the bean properties. |

### validateAction(Action, List<String>)

```java
void validateAction(Action action, List<String> actionKeys) throws BeanValidationException
```

Called by the install4j GUI at design-time to check the validity of the bean properties.
This method is called repeatedly when the user switches between different actions as well
as by the compiler.


**Parameters:**

- `action` — the action that should be validated
- `actionKeys` — the action keys configured for the [`ActionList`](../beans/ActionList.md) property by calling
[`ActionListPropertyDescriptor.setActionKeys`](ActionListPropertyDescriptor.md#setactionkeys-string)

**Throws:**

- `BeanValidationException` — Throw this exception if the bean properties are not valid

