That property is set on the marshaller. I guess for an unmarshaller, the following block:
| /**
| * Get the JAXB Unmarshaller
| * @param pkgName The package name for the jaxb context
| * @param schemaLocation location of the schema to validate against
| * @return unmarshaller
| * @throws Exception
| */
| public static Unmarshaller getValidatingUnmarshaller(String pkgName, String
schemaLocation)
| throws Exception
| {
| Unmarshaller unmarshaller = getUnmarshaller(pkgName);
| //Validate against schema
| ClassLoader tcl = SecurityActions.getContextClassLoader();
| URL schemaURL = tcl.getResource(schemaLocation);
| if(schemaURL == null)
| throw new IllegalStateException("Schema URL is null:" +
schemaLocation);
| SchemaFactory scFact =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
| Schema schema = scFact.newSchema(schemaURL);
| unmarshaller.setSchema(schema);
|
| return unmarshaller;
| }
|
|
The code I picked up for this thread are from my class here:
http://anonsvn.jboss.org/repos/jbossidentity/identity-federation/trunk/id...
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219276#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...