This is not part of the JAXB 2 specification. If you have an XML schema you can set it on the Unmarshaller to enable validation. You can add bean validation JSR 303 annotations to your model.
JAXB :: Validation of XML during Unmarshalling
JAXB Generated classes only capture the structural information from the XML schema that is used to generate the classes, but they ignore any additional constraints on the data e.g allowed set of valu
JAXB Generated classes only capture the structural information from the XML schema that is used to generate the classes, but they ignore any additional constraints on the data e.g allowed set of values(enumerations), max value allowed etc. Does it mean that if i do not have a schema i c开发者_运维问答an only validate structural information and not the constraints on the data? If so why was this not allowed with JAXB, annotations could have very well also caputred the constraints?
Best Regards,
Keshav
0
0
0
精彩评论