use of org.apache.cxf.databinding.AbstractDataBinding in project cxf by apache.
the class AbstractServiceFactoryBean method fillDataBindingSchemas.
private void fillDataBindingSchemas() {
ResourceManager rr = getBus().getExtension(ResourceManager.class);
List<DOMSource> schemas = new ArrayList<>();
for (String l : schemaLocations) {
URL url = rr.resolveResource(l, URL.class);
if (url == null) {
try (URIResolver res = new URIResolver(l)) {
if (!res.isResolved()) {
throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l));
}
url = res.getURL();
} catch (IOException e) {
throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e);
}
}
Document d;
try (InputStream in = url.openStream()) {
d = StaxUtils.read(in);
} catch (Exception e) {
throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e);
}
schemas.add(new DOMSource(d, url.toString()));
}
((AbstractDataBinding) getDataBinding()).setSchemas(schemas);
}
Aggregations