You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "james strachan (JIRA)" <ji...@apache.org> on 2011/02/21 14:11:38 UTC

[jira] Created: (CAMEL-3693) have a way to validate the model is correct according to JAXB and bean introspection rules

have a way to validate the model is correct according to JAXB and bean introspection rules
------------------------------------------------------------------------------------------

                 Key: CAMEL-3693
                 URL: https://issues.apache.org/jira/browse/CAMEL-3693
             Project: Camel
          Issue Type: Improvement
            Reporter: james strachan


Its very easy for us to create JAXB objects which can only be used from JAXB marshalling and not from Java code or introspection. Or that we can introduce JAXB bugs by inconsistent annotation usage.

We should write a little validator tool that iterates through all *Definition classes inside org.apache.camel.model.* and checks that...

* for every field which is annotated with @XmlElementRef or @XmlAttribute or @XmlElement that it has a valid getter and setter
* all getters of type "boolean" are called isFoo whereas all other getters (including of type Boolean) are called getFoo
* we are careful to specify @XmlAccessorType(XmlAccessType.FIELD) on the class - or at least are consistent in JAXB annotations being either all on fields or all on properties (e.g. ResequenceDefinition is missing right now and has mixed JAXB annotations)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CAMEL-3693) have a way to validate the model is correct according to JAXB and bean introspection rules

Posted by "james strachan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997898#comment-12997898 ] 

james strachan commented on CAMEL-3693:
---------------------------------------

another one I spotted is OnExceptionDefinition - which has its own Output definition but doesn't extend OutputDefinition.

So we should maybe check for EIP patterns as to they should probably extend OutputDefinition or NoOutputDefinition unless there's a really good reason or something?

> have a way to validate the model is correct according to JAXB and bean introspection rules
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3693
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3693
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: james strachan
>
> Its very easy for us to create JAXB objects which can only be used from JAXB marshalling and not from Java code or introspection. Or that we can introduce JAXB bugs by inconsistent annotation usage.
> We should write a little validator tool that iterates through all *Definition classes inside org.apache.camel.model.* and checks that...
> * for every field which is annotated with @XmlElementRef or @XmlAttribute or @XmlElement that it has a valid getter and setter
> * all getters of type "boolean" are called isFoo whereas all other getters (including of type Boolean) are called getFoo
> * we are careful to specify @XmlAccessorType(XmlAccessType.FIELD) on the class - or at least are consistent in JAXB annotations being either all on fields or all on properties (e.g. ResequenceDefinition is missing right now and has mixed JAXB annotations)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CAMEL-3693) have a way to validate the model is correct according to JAXB and bean introspection rules

Posted by "james strachan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997879#comment-12997879 ] 

james strachan commented on CAMEL-3693:
---------------------------------------

another validation rule to watch. Patterns extending OutputDefinition by definition take output; so they should not override getOutput() to return an unmodifiable collection. Am looking at you SortDefinition.

It also leads to more elegant XML.

{code}
<from uri="foo">
  <sort>
    <xpath>/foo</xpath>
    <to uri="whanot"/>
  </sort>
</from>
{code}


> have a way to validate the model is correct according to JAXB and bean introspection rules
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3693
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3693
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: james strachan
>
> Its very easy for us to create JAXB objects which can only be used from JAXB marshalling and not from Java code or introspection. Or that we can introduce JAXB bugs by inconsistent annotation usage.
> We should write a little validator tool that iterates through all *Definition classes inside org.apache.camel.model.* and checks that...
> * for every field which is annotated with @XmlElementRef or @XmlAttribute or @XmlElement that it has a valid getter and setter
> * all getters of type "boolean" are called isFoo whereas all other getters (including of type Boolean) are called getFoo
> * we are careful to specify @XmlAccessorType(XmlAccessType.FIELD) on the class - or at least are consistent in JAXB annotations being either all on fields or all on properties (e.g. ResequenceDefinition is missing right now and has mixed JAXB annotations)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (CAMEL-3693) have a way to validate the model is correct according to JAXB and bean introspection rules

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3693.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.0

trunk: 1074197.

> have a way to validate the model is correct according to JAXB and bean introspection rules
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3693
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3693
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: james strachan
>            Assignee: Claus Ibsen
>             Fix For: 2.7.0
>
>
> Its very easy for us to create JAXB objects which can only be used from JAXB marshalling and not from Java code or introspection. Or that we can introduce JAXB bugs by inconsistent annotation usage.
> We should write a little validator tool that iterates through all *Definition classes inside org.apache.camel.model.* and checks that...
> * for every field which is annotated with @XmlElementRef or @XmlAttribute or @XmlElement that it has a valid getter and setter
> * all getters of type "boolean" are called isFoo whereas all other getters (including of type Boolean) are called getFoo
> * we are careful to specify @XmlAccessorType(XmlAccessType.FIELD) on the class - or at least are consistent in JAXB annotations being either all on fields or all on properties (e.g. ResequenceDefinition is missing right now and has mixed JAXB annotations)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (CAMEL-3693) have a way to validate the model is correct according to JAXB and bean introspection rules

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-3693:
----------------------------------

    Assignee: Claus Ibsen

> have a way to validate the model is correct according to JAXB and bean introspection rules
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3693
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3693
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: james strachan
>            Assignee: Claus Ibsen
>
> Its very easy for us to create JAXB objects which can only be used from JAXB marshalling and not from Java code or introspection. Or that we can introduce JAXB bugs by inconsistent annotation usage.
> We should write a little validator tool that iterates through all *Definition classes inside org.apache.camel.model.* and checks that...
> * for every field which is annotated with @XmlElementRef or @XmlAttribute or @XmlElement that it has a valid getter and setter
> * all getters of type "boolean" are called isFoo whereas all other getters (including of type Boolean) are called getFoo
> * we are careful to specify @XmlAccessorType(XmlAccessType.FIELD) on the class - or at least are consistent in JAXB annotations being either all on fields or all on properties (e.g. ResequenceDefinition is missing right now and has mixed JAXB annotations)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira