Module org.mule.sdk.api
Annotation Interface ParameterGroup
@Target({FIELD,PARAMETER})
@Retention(RUNTIME)
@Documented
@MinMuleVersion("4.5.0")
public @interface ParameterGroup
Allows to define a group of parameters which share some kind of special relationship and thus makes sense for them to belong to
the same group. This grouping is done by placing these parameters as fields of the same Java class, and then use that class
alongside this annotation.
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:
{@code
public class Operations {
public void hello(String message, @ParameterGroup Options options) {
...
}
public void goodBye(String message, @ParameterGroup Options options) {
}
}
</pre>
<p/>
In this case, both operations will have three parameters: message, color and mode.
<p/>
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
@since 1.0-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIftrue, the Group will be shown as an inline element of the DSL -
Field Summary
Fields
-
Field Details
-
ADVANCED
Group name for parameters that are considered for advanced usage.- See Also:
-
CONNECTION
Group name for parameters that are considered to be part of a connection configuration.- See Also:
-
-
Element Details
-
name
String nameThe name of the group being defined. This name cannot be equivalent toParameterGroupModel.DEFAULT_GROUP_NAME
-
-
-
showInDsl
boolean showInDslIftrue, the Group will be shown as an inline element of the DSL- Default:
- false
-