SAMLAssertionUtils extends XSDAbstractUtils { @Override public JAXBContext getJAXBContext() throws JAXBException { if (jc == null) { jc = JAXBContext.newInstance(ObjectFactory.class, eu.europa.esig.xmlenc.jaxb.ObjectFactory.class, eu.europa.esig.soap.jaxb.envelope.ObjectFactory.class, eu.europa.esig.saml.jaxb.assertion.ObjectFactory.class, eu.europa.esig.saml.jaxb.authn.context.ObjectFactory.class, eu.europa.esig.saml.jaxb.dce.ObjectFactory.class, eu.europa.esig.saml.jaxb.ecp.ObjectFactory.class, eu.europa.esig.saml.jaxb.protocol.ObjectFactory.class); } return jc; } private  SAMLAssertionUtils(); static SAMLAssertionUtils getInstance(); @Override JAXBContext getJAXBContext(); @Override List<Source> getXSDSources(); static final String SAML_ASSERTION_SCHEMA_LOCATION; static final String SAML_DCE_SCHEMA_LOCATION; static final String SAML_ECP_SCHEMA_LOCATION; static final String SAML_METADATA_SCHEMA_LOCATION; static final String SAML_PROTOCOL_SCHEMA_LOCATION; static final String SAML_X500_SCHEMA_LOCATION; static final String SAML_XACML_SCHEMA_LOCATION; static final String SAML_AUTHN_CONTEXT_TYPES_SCHEMA_LOCATION; }
@SuppressWarnings("unchecked") @Test public void test() throws JAXBException, SAXException { JAXBContext jc = samlAssertionUtils.getJAXBContext(); assertNotNull(jc); Schema schema = samlAssertionUtils.getSchema(); assertNotNull(schema); File file = new File("src/test/resources/sample-saml-assertion.xml"); Unmarshaller unmarshaller = jc.createUnmarshaller(); unmarshaller.setSchema(schema); JAXBElement<AssertionType> unmarshalled = (JAXBElement<AssertionType>) unmarshaller.unmarshal(file); assertNotNull(unmarshalled); }