[jboss-dev-forums] [Design of POJO Server] - Re: JAXB Deployer
anil.saldhana@jboss.com
do-not-reply at jboss.com
Wed Mar 18 17:37:20 EDT 2009
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/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLBaseFactory.java
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219276#4219276
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219276
More information about the jboss-dev-forums
mailing list