camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Commented] (CAMEL-6768) @Header @Body @Property bean parameter binding - add mandatory option
Date Sat, 11 Jul 2015 06:38:04 GMT


Claus Ibsen commented on CAMEL-6768:

The problem is that

public @interface Header {
    String value();

Is a single value so you can just do @Header("foo") but if you add another option like

public @interface Header {
    String value();
    boolean required() default false;

Then you must specify the header as @Header(value = "foo") or change the name of value to

public @interface Header {
    String name();
    boolean required() default false;

so you can do @Header(name = "foo")

In all cases its a api breaking change, and also its more verbose.

> @Header @Body @Property bean parameter binding - add mandatory option
> ---------------------------------------------------------------------
>                 Key: CAMEL-6768
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: Future
> See
> We could have an attribute mandatory = true, which is default true for these bean parameter
annotations. Then people can set it to false, if a @Header is not mandatory (eg do not fail
if the header is not present).

This message was sent by Atlassian JIRA

View raw message