use of org.apache.cxf.service.model.ServiceSchemaInfo in project cxf by apache.
the class WSDLServiceBuilder method getSchemas.
private void getSchemas(Definition def, ServiceInfo serviceInfo) {
ServiceSchemaInfo serviceSchemaInfo = null;
WSDLManager wsdlManager = bus.getExtension(WSDLManager.class);
if (wsdlManager != null) {
serviceSchemaInfo = wsdlManager.getSchemasForDefinition(def);
}
if (serviceSchemaInfo == null) {
SchemaUtil schemaUtil = new SchemaUtil(bus, this.schemaList);
schemaUtil.getSchemas(def, serviceInfo);
serviceSchemaInfo = new ServiceSchemaInfo();
serviceSchemaInfo.setSchemaElementList(this.schemaList);
serviceSchemaInfo.setSchemaCollection(serviceInfo.getXmlSchemaCollection());
serviceSchemaInfo.setSchemaInfoList(serviceInfo.getSchemas());
if (wsdlManager != null) {
wsdlManager.putSchemasForDefinition(def, serviceSchemaInfo);
}
} else {
serviceInfo.setServiceSchemaInfo(serviceSchemaInfo);
schemaList.putAll(serviceSchemaInfo.getSchemaElementList());
}
}
use of org.apache.cxf.service.model.ServiceSchemaInfo in project cxf by apache.
the class WSDLRefValidator method processSchemas.
private void processSchemas(Bus bus) {
try {
ServiceSchemaInfo info = bus.getExtension(WSDLManager.class).getSchemasForDefinition(definition);
if (info == null) {
getSchemas(bus);
} else {
schemaCollection = info.getSchemaCollection();
}
checkTargetNamespace(this.definition.getTargetNamespace());
} catch (Exception ex) {
throw new ToolException(ex);
}
}
use of org.apache.cxf.service.model.ServiceSchemaInfo in project cxf by apache.
the class WSDLRefValidator method getSchemas.
private void getSchemas(Bus bus) {
Map<String, Element> schemaList = new HashMap<>();
SchemaUtil schemaUtil = new SchemaUtil(bus, schemaList);
List<SchemaInfo> si = new ArrayList<>();
schemaUtil.getSchemas(definition, schemaCollection, si);
ServiceSchemaInfo ssi = new ServiceSchemaInfo();
ssi.setSchemaCollection(schemaCollection);
ssi.setSchemaInfoList(si);
ssi.setSchemaElementList(schemaList);
bus.getExtension(WSDLManager.class).putSchemasForDefinition(definition, ssi);
}
Aggregations