@MinMuleVersion("4.1") @Target({PARAMETER,FIELD}) @Retention(RUNTIME) @Documented public @interface Optional
Marks a Parameter field a optional. All configurable attributes that don't include this annotation are considered required
Since:
1.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The default value to use if the user doesn't specify a value for the parameter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Because Java doesn't allow null values as defaults in annotations, this value is used to represent a null.
    static final String
    Denotes that if the parameter is not defined, the value will be taken from the message payload.
  • Field Details

    • PAYLOAD

      static final String PAYLOAD
      Denotes that if the parameter is not defined, the value will be taken from the message payload.
      See Also:
    • NULL

      static final String NULL
      Because Java doesn't allow null values as defaults in annotations, this value is used to represent a null. This value should only be used by the platform
      See Also:
  • Element Details

    • defaultValue

      String defaultValue
      The default value to use if the user doesn't specify a value for the parameter. It can be the value itself or an expression. Since null values are not allowed as default values in java annotations, the special NULL value was to created to reference that the parameter should default to null
      Returns:
      the default value
      Default:
      "THIS IS A SPECIAL NULL VALUE - DO NOT USE"