use of org.whole.lang.xsd.model.NamespaceDecl in project whole by wholeplatform.
the class AttributesPreprocessor method processNoNamespaceSchemaLocation.
protected void processNoNamespaceSchemaLocation(String schemaLocationUrl) {
String targetNamespace = calculateInternalNamespace(true);
Schema schema = SchemaUtils.load(targetNamespace, schemaLocationUrl, getFolderLocation(), getLSResourceResolver());
// add the generated default namespace to the schema
final XsdEntityFactory xef = XsdEntityFactory.instance;
NamespaceDecl namespaceDecl = xef.createNamespaceDecl();
namespaceDecl.setUri(xef.createAnyURI(targetNamespace));
schema.getNamespaces().add(namespaceDecl);
schema.setTargetNamespace(xef.createAnyURI(targetNamespace));
if (XsdDeployStrategies.shouldDeploy(bindings, targetNamespace))
SchemaUtils.deploy(schema, BindingManagerFactory.instance.createArguments());
redefineDefaultNamespace(namespaces, targetNamespace);
}
use of org.whole.lang.xsd.model.NamespaceDecl in project whole by wholeplatform.
the class NamespaceDeclPart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
NamespaceDecl entity = getModelEntity();
List<IEntity> children = new ArrayList<IEntity>(2);
children.add(entity.getPrefix());
children.add(entity.getUri());
return children;
}
use of org.whole.lang.xsd.model.NamespaceDecl in project whole by wholeplatform.
the class XsdPrettyPrinterVisitor method visit.
@Override
public void visit(IEntity entity) {
if (Matcher.match(XsdEntityDescriptorEnum.NamespaceDecl, entity)) {
NamespaceDecl nsDecl = (NamespaceDecl) entity;
IPrettyPrintWriter prettyPrintWriter = getOperation().getPrettyPrintWriter();
prettyPrintWriter.printRaw(nsDecl.getPrefix().getValue());
prettyPrintWriter.printRaw("=");
prettyPrintWriter.printRaw(nsDecl.getUri().getValue());
} else
super.visit(entity);
}
Aggregations