What approach and structure should I use to create a model validation system in java, similar to the model validation in C#?
I’d like to be able to mark or annotate a field as being required or be able to set a constraint (length, max size, etc), and be able to provide a message.
What would a good approach be in order to implement this?
Have a look at the bean validation framework JSR-303, here’s a link to an article http://java.dzone.com/articles/bean-validation-and-jsr-303
In the case for Android, see Richard Kennards comment on this article,
http://java.dzone.com/articles/jsr-303-and-jvm-web-framework