users@jaxb.java.net

getting null validation message

From: Damon Fensterman <dfensterman_at_yahoo.com>
Date: Thu, 17 Apr 2003 09:10:06 -0600

Consider the following schema fragement:

...
    <xsd:element name="dob" type="posixDateReq" minOccurs="1" maxOccurs="1"/>

...
    <xsd:simpleType name="posixDateReq">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="((((0[13578])|([13578])|(1[02]))[/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[/](([1-9])|([0-2][0-9])|(30)))|((2|02)[/](([1-9])|([0-2][0-9]))))[/]\d{4}"/>
        </xsd:restriction>
    </xsd:simpleType>
...

basically the regular expression allows me to do my date format as mm/dd/yyyy.

When I do JAXB on demand validation, this expression successfully catches bad date formats. It's also supposed to reject a blank date (e.g. <dob/>). If I put no date, the element DOES get rejected. However, in the ValidationEventCollector the getLocator().getObject().getMessage() method of the ValidationEvent for this row returns null. This works fine for all my other validations.

Why am I getting a null message?