# VisibilityDiscriminator

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

```java
interface VisibilityDiscriminator
```

Interface for controlling the visibility of child properties based on the value of the parent property.
This applies to properties that have been arranged in a tree-like structure by calling
[`Install4JPropertyDescriptor.setParentProperty`](Install4JPropertyDescriptor.md#setparentproperty-string) on their property descriptors.
If you register an implementation of this interface with
[`Install4JPropertyDescriptor.setVisibilityDiscriminator`](Install4JPropertyDescriptor.md#setvisibilitydiscriminator-visibilitydiscriminator),
each time the value of the parent property changes, a callback will be made to
[`VisibilityDiscriminator.isVisible`](VisibilityDiscriminator.md#isvisible-bean-object) in order to decide whether
the child property should be visible or not.

For boolean parent properties, if you do not register a visibility discriminator, the children will be
hidden if the user selection of the parent property is `false`.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`isVisible(Bean, Object)`](#isvisible-bean-object) | `boolean` | Determine if the property for which this callback has been registered should be visible or not. |

### isVisible(Bean, Object)

```java
boolean isVisible(Bean bean, Object parentPropertyValue)
```

Determine if the property for which this callback has been registered should be visible or not.
Each time the value of the parent property changes, this method will be called.


**Parameters:**

- `bean` — the bean to which both parent and child property belong
- `parentPropertyValue` — the value of the parent property

**Returns:** whether the child property should be visible or not

