/** * @see org.overlord.sramp.common.visitors.HierarchicalArtifactVisitorAdapter#visit(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ElementDeclaration) */ @Override public void visit(ElementDeclaration artifact) { super.visit(artifact); try { setProperty("sramp:namespace", artifact.getNamespace()); //$NON-NLS-1$ setProperty("sramp:ncName", artifact.getNCName()); //$NON-NLS-1$ } catch (Exception e) { throw new RuntimeException(e); } }
private void processElementDeclarations(Element schema, String targetNS) throws XPathExpressionException { // xpath expression to find all global element decls NodeList nodes = (NodeList) query(schema, "./xsd:element", XPathConstants.NODESET); for (int idx = 0; idx < nodes.getLength(); idx++) { Element node = (Element) nodes.item(idx); if (node.hasAttribute("name")) { String nsName = node.getAttribute("name"); ElementDeclaration elementDecl = new ElementDeclaration(); elementDecl.setArtifactType(BaseArtifactEnum.ELEMENT_DECLARATION); elementDecl.setName(nsName); elementDecl.setNamespace(targetNS); elementDecl.setNCName(nsName); derivedArtifacts.add(elementDecl); } } }
} else if (artifact instanceof ElementDeclaration) { ElementDeclaration arty = (ElementDeclaration) artifact; index.put(new QName(arty.getArtifactType().toString(), arty.getNCName()), artifact); } else if (artifact instanceof AttributeDeclaration) { AttributeDeclaration arty = (AttributeDeclaration) artifact; Assert.assertNotNull(artifact); Assert.assertEquals("findResponse", artifact.getName()); //$NON-NLS-1$ Assert.assertEquals("findResponse", ((ElementDeclaration) artifact).getNCName()); //$NON-NLS-1$ Assert.assertEquals("http://ewittman.redhat.com/sample/2012/09/wsdl/sample.wsdl/types", ((ElementDeclaration) artifact).getNamespace()); //$NON-NLS-1$
elementTarget.setArtifactType(ElementEnum.ELEMENT); if (elementRef != null) { elementTarget.setValue(elementRef.getUuid()); } else { elementTarget.getOtherAttributes().put(UNRESOLVED_REF, qname.toString());
/** * @see org.overlord.sramp.common.visitors.HierarchicalArtifactVisitorAdapter#visit(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ElementDeclaration) */ @Override public void visit(ElementDeclaration artifact) { super.visit(artifact); artifact.setNamespace(getProperty(jcrNode, "sramp:namespace")); //$NON-NLS-1$ }
elementNames.add(((ElementDeclaration) dat).getNCName()); } else if (dat instanceof AttributeDeclaration) { numAttributes++;
/** * Create an instance of {@link ElementDeclaration } * */ public ElementDeclaration createElementDeclaration() { return new ElementDeclaration(); }
elementTarget.setArtifactType(ElementDeclarationEnum.ELEMENT_DECLARATION); if (elementRef != null) { elementTarget.setValue(elementRef.getUuid()); } else { relationshipSources.add(new QNameRelationshipSource(qname, elementTarget, null,
/** * @see org.artificer.common.visitors.HierarchicalArtifactVisitor#visit(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ElementDeclaration) */ @Override public void visit(ElementDeclaration artifact) { super.visit(artifact); artifact.setNamespace(getProperty("namespace")); }
/** * @see org.artificer.common.visitors.HierarchicalArtifactVisitor#visit(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ElementDeclaration) */ @Override public void visit(ElementDeclaration artifact) { super.visit(artifact); try { createProperty("namespace", artifact.getNamespace()); createProperty("ncName", artifact.getNCName()); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Processes the global element declarations found in the schema. * @param derivedArtifacts * @param sourceArtifact * @param schema * @param xpath * @throws XPathExpressionException */ private void processElementDeclarations(Collection<BaseArtifactType> derivedArtifacts, BaseArtifactType sourceArtifact, Element schema, XPath xpath) throws XPathExpressionException { String targetNS = schema.getAttribute("targetNamespace"); //$NON-NLS-1$ // xpath expression to find all global element decls NodeList nodes = (NodeList) this.query(xpath, schema, "./xsd:element", XPathConstants.NODESET); //$NON-NLS-1$ for (int idx = 0; idx < nodes.getLength(); idx++) { Element node = (Element) nodes.item(idx); if (node.hasAttribute("name")) { //$NON-NLS-1$ String nsName = node.getAttribute("name"); //$NON-NLS-1$ ElementDeclaration elementDecl = new ElementDeclaration(); elementDecl.setArtifactType(BaseArtifactEnum.ELEMENT_DECLARATION); elementDecl.setName(nsName); elementDecl.setNamespace(targetNS); elementDecl.setNCName(nsName); derivedArtifacts.add(elementDecl); } } }
if (artifact instanceof ElementDeclaration) { ElementDeclaration element = (ElementDeclaration) artifact; QName key = new QName(element.getNamespace(), element.getNCName()); elementIndex.put(key, element); } else if (artifact instanceof SimpleTypeDeclaration) {
if (artifact instanceof ElementDeclaration) { ElementDeclaration element = (ElementDeclaration) artifact; QName key = new QName(element.getNamespace(), element.getNCName()); elementIndex.put(key, element); } else if (artifact instanceof SimpleTypeDeclaration) {
Assert.assertNull(part.getType()); ElementDeclaration elem = (ElementDeclaration) getArtifactByTarget(part.getElement()); Assert.assertEquals(findElement.getUuid(), elem.getUuid()); Assert.assertEquals(findResponseElement.getUuid(), elem.getUuid()); Assert.assertNull(part.getType()); elem = (ElementDeclaration) getArtifactByTarget(part.getElement()); Assert.assertEquals(findResponseElement.getUuid(), elem.getUuid());