Skip to main content
Skip table of contents

Creating the Configuration Bean

A configuration bean is used to bundle configuration parameters of an adapter instance and contains methods for setting the configuration parameters. Adapter instances can access the configuration bean object using the method getConfigurationBean().

Creating a Configuration Bean

How to create a new Configuration Bean class in the package

  1. Define variables which serve as configuration parameters (only of the type String).
  2. The @AdapterParameter annotation specifies a field as adapter configuration. There can either be a Configuration Bean class in which all parameters are defined, or the definition can be made in the adapter class itself (a mixture is not possible!).
  3. Define set/get methods for each configuration parameter. They have to be named following the pattern: set<Parameter name>(<value>) or get<Parameter name>().
    The basic frame of the configuration bean is now ready.

Defining Metadata for Adapter Parameters

To define metadata for adapter parameters the @AdapterParameter annotation is used:

Field

Description

Mandatory

description

Textual description of the parameter's purpose

yes
dataType

Parameter type

Possible values: PASSWORD, BOOLEAN, STRING, ARRAY, DOUBLE, INTEGER

yes
displayNameThe parameter's display name. The field's name is default.no
optional

Specifies whether the parameter is mandatory or not

Possible values:

  • true: the parameter is not mandatory
  • false: the parameter is mandatory (default) 
no
defaultValueSets an initial parameter valueno
The annotation @AllowedPropertyValue has to be used additionally, if dataType is set to ARRAY in order to set the possible values.

Field

Description

displayNameSpecifies the value's display name
value

Technical identifier that is written to the field during selection

Example

JAVA
import de.softproject.integration.adapter.annotations.AdapterParameter;
import de.softproject.integration.adapter.core.AdapterParameterDataType;
 
public class SimpleChartConfiguration {
 
    @AdapterParameter(dataType = AdapterParameterDataType.STRING, description = "set the title of the chart")
    private String chartTitle;
    @AdapterParameter(dataType = AdapterParameterDataType.INTEGER, description = "set the width of the chart", defaultValue = "300")
    private int chartWidth = 300;
 
    public String getChartTitle() {
        return chartTitle;
    }
 
    public void setChartTitle(String chartTitle) {
        this.chartTitle = chartTitle;
    }
 
    public int getChartWidth() {
        return chartWidth;
    }
 
    public void setChartWidth(int chartWidth) {
        this.chartWidth = chartWidth;
    }
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.