/** * @see org.overlord.sramp.common.visitors.HierarchicalArtifactVisitorAdapter#visit(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.XsdDocument) */ @Override public void visit(XsdDocument artifact) { super.visit(artifact); artifact.setTargetNamespace(getProperty(jcrNode, "sramp:targetNamespace")); //$NON-NLS-1$ }
/** * Process the entire schema for all derived content. * @param derivedArtifacts * @param artifact * @param schema * @param xpath * @throws XPathExpressionException */ public void processSchema(Collection<BaseArtifactType> derivedArtifacts, BaseArtifactType artifact, Element schema, XPath xpath) throws XPathExpressionException { String targetNS = schema.getAttribute("targetNamespace"); //$NON-NLS-1$ if (artifact instanceof XsdDocument) ((XsdDocument) artifact).setTargetNamespace(targetNS); processElementDeclarations(derivedArtifacts, artifact, schema, xpath); processAttributeDeclarations(derivedArtifacts, artifact, schema, xpath); processSimpleTypeDeclarations(derivedArtifacts, artifact, schema, xpath); processComplexTypeDeclarations(derivedArtifacts, artifact, schema, xpath); // Pre-set the UUIDs for all the derived artifacts. This is useful // if something downstream needs to reference them. for (BaseArtifactType derivedArtifact : derivedArtifacts) { derivedArtifact.setUuid(UUID.randomUUID().toString()); } }
@Override protected void derive() throws IOException { try { String targetNS = rootElement.getAttribute("targetNamespace"); if (getPrimaryArtifact() instanceof XsdDocument) { ((XsdDocument) getPrimaryArtifact()).setTargetNamespace(targetNS); } deriveXsd(rootElement); processImportedXsds(rootElement, targetNS); processIncludedXsds(rootElement, targetNS); processRedefinedXsds(rootElement, targetNS); } catch (Exception e) { throw new IOException(e); } }
/** * @see org.artificer.common.visitors.HierarchicalArtifactVisitor#visit(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.XsdDocument) */ @Override public void visit(XsdDocument artifact) { super.visit(artifact); artifact.setTargetNamespace(getProperty("targetNamespace")); try { artifact.getImportedXsds().addAll(getRelationships( "importedXsds", artificerArtifact, XsdDocumentTarget.class)); artifact.getIncludedXsds().addAll(getRelationships( "includedXsds", artificerArtifact, XsdDocumentTarget.class)); artifact.getRedefinedXsds().addAll(getRelationships( "redefinedXsds", artificerArtifact, XsdDocumentTarget.class)); } catch (Exception e) { throw new RuntimeException(e); } }