## install4j API documentation

## com.install4j.api.beaninfo
Interface EnumerationMapper

    public interface EnumerationMapper

Interface for mapping values and descriptions of enumerated properties. Instances of this class can be registered with `Install4JBeanInfo.setEnumerationMappers(EnumerationMapper[])`. In the install4j GUI, an enumerated property will be displayed with the enumeration entry name that corresponds to the object value of the property and the user can choose a value from a drop-down list.

Field Summary
`static java.lang.String` | `DEFAULT_CONTEXT` A default context that you can use in the `getContext` method if there is only one enumeration mapper for the property type returned by `getEnumerationClass`

Method Summary
`java.lang.String` | `getContext()` The property descriptor of an enumerated property must have a non-null context that corresponds to the return value of this method.
`java.lang.Class` | `getEnumerationClass()` Return the property type for which this enumeration mapper is eligible.
`EnumerationMapEntry[]` | `getEnumerationMapEntries()` Defines the enumeration.

Field Detail

### DEFAULT_CONTEXT

    static final java.lang.String DEFAULT_CONTEXT

  A default context that you can use in the `getContext` method if there is only one enumeration mapper for the property type returned by `getEnumerationClass`

  See Also:
    `getEnumerationClass()`, `getContext()`, Constant Field Values

Method Detail

### getEnumerationClass

    java.lang.Class getEnumerationClass()

  Return the property type for which this enumeration mapper is eligible. The objects in the @{EnumerationMapEntry} returned by `getEnumerationMapEntries` must be of this type.

  Returns:
    the class of the enumerated property
  See Also:
    `getEnumerationMapEntries()`

### getEnumerationMapEntries

    EnumerationMapEntry[] getEnumerationMapEntries()

  Defines the enumeration.

  Returns:
    the enumeration map entries

### getContext

    java.lang.String getContext()

  The property descriptor of an enumerated property must have a non-null context that corresponds to the return value of this method. In this way the runtime knows that this enumeration mapper should be used for displaying and editing properties. The context must not be globally unique, enumeration mappers of other property types can use the same context value.

  For classes that do not have default handlers in install4j, the enumeration mapper will also be used if only the `getEnumerationClass` method returns the class of the property and the context of the property is not set. However, it is safer not to rely on that behavior.

  Returns:
    the context that will be used by the enumerated properties