Hey Alexey:
I'm looking at the absolute latest JBoss XB (now, at least), specifically MarshallerImpl vs XercesXSMarshaller.
It is plain to see (IMO) that MarshallerImpl does *not* throw any exceptions if a required attribute is missing. I just ran a test to verify.
I did manage to get one marshaller to throw such an exception (after slight modification). I took the XercesXSMarshaller's and added the following code starting at 695:
} // end if attrValue != null else if( currentAttribute.getRequired()){ // its required and is not present. Must throw exception String name = currentAttribute.getAttrDeclaration().getName(); throw new JBossXBRuntimeException("Required Attribute " + name + " is not present"); }
Also, I suggest putting @deprecated tags in recently deprecated classes ;)
Required=true was used only to check that there is a Java property for the xml attribute in the Java class.
I've created and fixed the jira issue for this.
http://jira.jboss.com/jira/browse/JBXB-124