@Override public Schema getSchema() { return this.jaxbUnmarshaller.getSchema(); }
public Schema getSchema() { return unmarshaller.getSchema(); }
public Schema getSchema() { return this.jaxbUnmarshaller.getSchema(); }
public Schema getSchema() { return delegate.getSchema(); }
/** * Delegates to the wrapped unmarshaller. */ @Override public Schema getSchema() { return unmarshaller.getSchema(); }
/** * Delegates to the wrapped unmarshaller. */ @Override public Schema getSchema() { return unmarshaller.getSchema(); }
@Override public Schema getSchema() { return unmarshaller.getSchema(); }
public Schema getSchema() { return unmarshaller.getSchema(); }
@Override public Schema getSchema() { return this.jaxbUnmarshaller.getSchema(); }
public Schema getSchema() { return unmarshaller.getSchema(); }
public Schema getSchema() { return this.jaxbUnmarshaller.getSchema(); }
public Schema getSchema() { return unmarshaller.getSchema(); }
public Schema getSchema() { return unmarshaller.getSchema(); }
@Override public Schema getSchema() { return this.jaxbUnmarshaller.getSchema(); }
public Schema getSchema() { return unmarshaller.getSchema(); }
public Schema getSchema() { return this.jaxbUnmarshaller.getSchema(); }
public Schema getSchema() { return getUnmarshaller().getSchema(); }
public Unmarshaller getUnmarshaller() { Unmarshaller u = unmarshaller.get(); if (!isValidating() && u.getSchema() != null) { u.setSchema(null); } else if (isValidating() && u.getSchema() == null) { // Load and set schema to validate against Schema schema; try { SchemaFactory schemaFactory = SchemaFactory .newInstance(W3C_XML_SCHEMA_NS_URI); List<URI> schemas = getAdditionalSchemas(); URL t2flowExtendedXSD = T2FlowParser.class .getResource(T2FLOW_EXTENDED_XSD); schemas.add(t2flowExtendedXSD.toURI()); List<Source> schemaSources = new ArrayList<>(); for (URI schemaUri : schemas) schemaSources.add(new StreamSource(schemaUri .toASCIIString())); Source[] sources = schemaSources .toArray(new Source[schemaSources.size()]); schema = schemaFactory.newSchema(sources); } catch (SAXException e) { throw new RuntimeException("Can't load schemas", e); } catch (URISyntaxException | NullPointerException e) { throw new RuntimeException("Can't find schemas", e); } u.setSchema(schema); } return u; }
public Unmarshaller getUnmarshaller() { Unmarshaller u = unmarshaller.get(); if (!isValidating() && u.getSchema() != null) { u.setSchema(null); } else if (isValidating() && u.getSchema() == null) { // Load and set schema to validate against Schema schema; try { SchemaFactory schemaFactory = SchemaFactory .newInstance(W3C_XML_SCHEMA_NS_URI); List<URI> schemas = getAdditionalSchemas(); URL scuflXSD = getClass().getResource(SCUFL_XSD); schemas.add(scuflXSD.toURI()); List<Source> schemaSources = new ArrayList<>(); for (URI schemaUri : schemas) schemaSources.add(new StreamSource(schemaUri .toASCIIString())); Source[] sources = schemaSources .toArray(new Source[schemaSources.size()]); schema = schemaFactory.newSchema(sources); } catch (SAXException e) { throw new RuntimeException("Can't load schema " + SCUFL_XSD, e); } catch (URISyntaxException | NullPointerException e) { throw new RuntimeException("Can't find schema " + SCUFL_XSD, e); } u.setSchema(schema); } return u; }
/** * Validate the given Agreement descriptor against the EndpointReference schema. * * @param EndpointReferenceDescriptorStream * @throws EndpointReferenceException * The validation has failed * @throws EndpointReferenceDescriptorException * Failed to create the validator */ public static void validateAgreementDescriptor(final InputStream agreementDescriptorStream) throws AgreementDescriptorException { final Validator validator = getUnMarshaller().getSchema().newValidator(); try { validator.validate(new StreamSource(agreementDescriptorStream)); } catch (final SAXException e) { throw new AgreementDescriptorException( "Failed to validate EndpointReference descriptor against Agreement schema", e); } catch (final IOException e) { throw new AgreementDescriptorException( "Failed to validate EndpointReference descriptor against Agreement schema", e); } }