@MinMuleVersion(value="4.1") @Target(value={FIELD,PARAMETER}) @Retention(value=RUNTIME) @Documented public @interface ParameterGroup
Unlike a regular pojo, the parameters defined in this class will be flattened and the owning ParameterizedModel will
not contain any reference to the defining class.
For example:
{
@code
@Extension
public class MyExtension {
@ParameterGroup("some group name")
private Options options;
}
public class Options {
@Parameter
private String color;
@Parameter
@Optional
private String mode;
private String owner;
}
}
The outcome of the code above is a configuration with two parameters called 'color' and 'mode', one required and the other
optional. The configuration has no attribute called options. If the Options class were to have another field also annotated
with ParameterGroup, then such fields will be ignored.
In this other example, the configuration that is augmented with this extra parameters will have the sum of Options and MoreOptions parameters. Those parameters will be flattened, meaning that the model will contain no reference to the fact that the MoreOptions parameters were nested inside Options. Each field annotated with this annotation must be a Java bean property (i.e: it needs to have setters and getters matching the field name).
Lastly, the annotation can be applied to a method which is defining an operation:
public class Operations {
public void hello(String message, @ParameterGroup Options options) {
...
}
public void goodBye(String message, @ParameterGroup Options options) {
}
}
In this case, both operations will have three parameters: message, color and mode.
Another consideration is that no parameter (in either a configuration or operation) obtained through this annotation can have a
name which collides with a parameter defined in the top level class or in a superior group of the parameter group hierarchy| Modifier and Type | Fields and Description |
|---|---|
static String |
ADVANCED
Group name for parameters that are considered for advanced usage.
|
static String |
CONNECTION
Group name for parameters that are considered to be part of a connection configuration.
|
| Modifier and Type | Required Element and Description |
|---|---|
String |
name
The name of the group being defined.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
showInDsl
If
true, the Group will be shown as an inline element of the DSL |
public static final String ADVANCED
public static final String CONNECTION
public abstract String name
ParameterGroupModel.DEFAULT_GROUP_NAMECopyright © 2025 MuleSoft, Inc.. All rights reserved.