Stripes

Add @Inherited to @ValidationMethod annotation

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.4.3
  • Fix Version/s: None
  • Component/s: Validation
  • Labels:
    None
  • Environment:
    All

Description

Just noticed an interesting behavior with the @ValidationMethod annotation, and its inheritence or lack thereof.

Imagine an abstract ActionBean AbstractFooActionBean, and a concrete subclass BarActionBean.

Suppose AbstractFooActionBean contains an annotation @Before for a pre-action method preAction() that executes before the BindingAndValidation stage. Suppose it also has a @ValidationMethod annotation for a validation method called validate(), which fires on event "save".

Now, suppose we have a concrete class BarActionBean with a method save() that handles event "save."

Now, suppose we locate and bind BarActionBean via an URLBinding or a useActionBean tag. The debugger shows preAction() fires, as expected, before the BindingAndValidation stage. Lovely! The reason this works is because the @Before annotation, as defined by Stripes, has an @Inherited annotation.

But when BarActionBean's "save" event executes, the @ValidationMethod does not fire – because there is no @Inherited annotation on the ValidationMethod annotation class.

This seems a little inconsistent. If the Before annotation is inherited, shouldn't the ValidationMethod annotation be inherited too? My request, therefore is to make the ValidationMethod annotation inherited.

Activity

Hide
Andrew Jaquith added a comment - 12/Aug/08 8:25 PM

My comments also apply equally to the @Validate and @ValidateNestedProperties annotations...

Show
Andrew Jaquith added a comment - 12/Aug/08 8:25 PM My comments also apply equally to the @Validate and @ValidateNestedProperties annotations...

People

Vote (0)
Watch (0)

Dates

  • Created:
    12/Aug/08 8:05 PM
    Updated:
    12/Aug/08 8:25 PM