Tuesday, June 16, 2009

DD Swing Portal System... Validation Component

Hi All,

Today I am creating an advisor mechanism which will control the validation of the components. The concept of validation is based on annotations provided by JPA and also provided by this framework.

The basic idea behind the validation is to add validation annotation to the setter methods of the POJO i.e. JPA. If the user is unable to add the validation annotation to the Setter methods then it will take the default from length attribute of @Column annotation which is associated to the Getter methods of the JPA.

For example if the Return Type is "String" and length specified in the @Column annotation is "10" then that component only could accept the Alpha-Numeric values upto the 10. But then there is no restriction for the Minimum value as we can foresee from the Database columns.

If the Return Type is Integer the component can accept only number values with precision.

If the Return Type is BigDecimal, Float then the component can accept the precision values for the number.

If the Return Type is Date then the component can accept Alpha Numeric with specific format defined by the Formatter of the Date component.

I am using JXlayer for displaying the error code and description for the component.

Hopefully, I will finish this Validation Advisor in a couple of days in a way that it will act as an independent modular component for validating the Form Components.


Regards


No comments: