You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by krishna behara <kr...@yahoo.com> on 2009/07/01 10:50:23 UTC

validating string input

hi, 

i need to validate String attributes before or as they are unmarshalled and set on the final that they are part of.
for instance consider the following class, i would like to do some input validation on "name" before setName is called and the value is set, and do the same thing for Integer. With JAXWS with Aegis databinding i was able to accomplish this by creating a new AegisContext and inserting a new type mapping for a string. I am trying to do achieve the same thing but with JAXRS (which is using JAXB).

thanks for any help on this.
Krishna789

@XmlRootElement(name="Input")
public class Person {
    String name;
    String language;
    Integer age;

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
         this.age = age;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getLanguage() {
        return language;
    }
    public void setLanguage(String language) {
        this.language = language;
    }
}