Annotation Interface DslArg


@Retention(RUNTIME) @Documented @Target({FIELD,TYPE}) public @interface DslArg
Marks a field in a Camel model Definition class as a primary argument for the Java DSL method call. Primary arguments appear inside the method parentheses (e.g., filter(simple("...")) rather than as chained attribute calls (e.g., .timeout("5000")). The Java DSL model writer code generator reads this annotation at build time to determine which fields to render as method arguments and how to render them.
Since:
4.21
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    When placed on a type (class), lists field names from superclasses whose @DslArg annotations should be ignored for this class.
    int
    Ordering position when multiple primary args exist in the same method call.
    boolean
    Whether this is a primary arg (inside method parentheses).
    How to render this field in generated Java DSL source code.
    For enumString render type: the simple name of the enum class (e.g., "ExchangePattern", "LoggingLevel").
  • Element Details

    • position

      int position
      Ordering position when multiple primary args exist in the same method call. Lower values come first. Default is 0.
      Default:
      0
    • renderType

      String renderType
      How to render this field in generated Java DSL source code.
      • "string" — quoted string: quote(value)
      • "class" — class literal: MyClass.class
      • "expression" — expression DSL: simple("...")
      • "expressionSub" — expression sub-element: unwrap ExpressionSubElementDefinition
      • "enumString" — enum constant from string: LoggingLevel.INFO
      • "long" — numeric literal (no quotes)
      • "classList" — list of class literals: Exception1.class, Exception2.class
      Empty string means auto-detect from the field's Java type.
      Default:
      ""
    • typeName

      String typeName
      For enumString render type: the simple name of the enum class (e.g., "ExchangePattern", "LoggingLevel"). This is used to generate the qualified enum constant reference in the Java DSL output.
      Default:
      ""
    • primary

      boolean primary
      Whether this is a primary arg (inside method parentheses). Default is true.
      Default:
      true
    • exclude

      String[] exclude
      When placed on a type (class), lists field names from superclasses whose @DslArg annotations should be ignored for this class. This allows subclasses to suppress inherited primary arguments that don't apply to their DSL method signature.
      Default:
      {}