/** * Retrieves the namespace URI of the given element node. * * @param object the context element node * @return Returns the namespace URI of the element node. */ public String getElementNamespaceUri(Object object) { OMElement attr = (OMElement) object; return attr.getQName().getNamespaceURI(); }
/** * @param omElement */ public void addReferenceParameter(OMElement omElement) { if (omElement == null) { return; } if (referenceParameters == null) { referenceParameters = new HashMap<QName, OMElement>(); } referenceParameters.put(omElement.getQName(), omElement); }
public static int getPayloadType(SOAPEnvelope envelope) { OMElement el = getXMLPayload(envelope); if (el.getQName().equals(BINARYELT)) { return BINARYPAYLOADTYPE; } else if (el.getQName().equals(TEXTELT)) { return TEXTPAYLOADTYPE; } else if (el.getQName().equals(MAPELT)) { return MAPPAYLOADTYPE; } else { return XMLPAYLOADTYPE; // default XML } }
protected boolean matches(OMNode node) { if (node instanceof OMElement) { QName thisQName = ((OMElement)node).getQName(); // A null givenName is an indicator to return all elements return givenQName == null || isEqual(givenQName, thisQName); } else { return false; } } }
@Override public final QName getName() { try { return axiomElement.getQName(); } catch (OMException ex) { throw new AxiomSoapElementException(ex); } }
@Override protected boolean matches(OMNode node) { return (node instanceof OMElement) && (isQNamesMatch(((OMElement)node).getQName(), this.namespace)); }
public void setSmartLifecycleLinks(OMElement locationConfiguration) throws RegistryException { Iterator confElements = locationConfiguration.getChildElements(); while (confElements.hasNext()) { OMElement confElement = (OMElement) confElements.next(); if (confElement.getQName().equals(new QName("key"))) { smartLifecycleLinks.add(confElement.getText()); } } }
public void setSmartLifecycleLinks(OMElement locationConfiguration) throws RegistryException { Iterator confElements = locationConfiguration.getChildElements(); while (confElements.hasNext()) { OMElement confElement = (OMElement)confElements.next(); if (confElement.getQName().equals(new QName("key"))) { smartLifecycleLinks.add(confElement.getText()); } } }
public static Iterator<OMElement> getPolicyChildren(OMElement parent) { List<OMElement> policies = new ArrayList<OMElement>(); Iterator children = parent.getChildElements(); while (children.hasNext()) { OMElement child = (OMElement)children.next(); if (Constants.isPolicyElement(child.getQName())) { policies.add(child); } } return policies.iterator(); }
/** * Constructor OMChildrenQNameIterator. * * @param parent * @param givenQName */ public FOMExtensionIterator(OMElement parent) { super(parent.getChildren()); this.namespace = parent.getQName().getNamespaceURI(); this.factory = (FOMFactory)parent.getOMFactory(); }
public static PolicyComponent getPolicyComponentFromOMElement( OMElement policyComponent) throws IllegalArgumentException { if (Constants.isPolicyElement(policyComponent.getQName())) { return PolicyEngine.getPolicy(policyComponent); } else if (Constants.isPolicyRef(policyComponent.getQName())) { return PolicyEngine.getPolicyReference(policyComponent); } else { throw new IllegalArgumentException( "Argument is neither a <wsp:Policy> nor a <wsp:PolicyReference> element"); } }
private void processElement(OMElement element, RequiredElements parent) { QName name = element.getQName(); if (SP12Constants.XPATH.equals(name)) { parent.addXPathExpression(element.getText()); Iterator namespaces = element.getNamespacesInScope(); while (namespaces.hasNext()) { OMNamespace nm = (OMNamespace) namespaces.next(); parent.addDeclaredNamespaces(nm.getNamespaceURI(), nm.getPrefix()); } } }
private void processElement(OMElement element, RequiredElements parent) { QName name = element.getQName(); if (SP11Constants.XPATH.equals(name)) { parent.addXPathExpression(element.getText()); Iterator namespaces = element.getNamespacesInScope(); while (namespaces.hasNext()) { OMNamespace nm = (OMNamespace) namespaces.next(); parent.addDeclaredNamespaces(nm.getNamespaceURI(), nm.getPrefix()); } } }
public byte[] decode(ContentType contentType, AxisMessage message) throws Exception { SOAPEnvelope envelope = message.getEnvelope(); OMElement wrapper = envelope.getBody().getFirstElement(); Assert.assertEquals(BaseConstants.DEFAULT_BINARY_WRAPPER, wrapper.getQName()); OMNode child = wrapper.getFirstOMChild(); Assert.assertTrue(child instanceof OMText); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ((DataHandler)((OMText)child).getDataHandler()).writeTo(baos); return baos.toByteArray(); } };
public <T extends Element> T getPreviousSibling(QName qname) { Element el = getPreviousSibling(); while (el != null) { OMElement omel = (OMElement)el; if (omel.getQName().equals(qname)) return (T)getWrapped((Element)omel); el = el.getPreviousSibling(); } return null; }
public <T extends Element> T getNextSibling(QName qname) { Element el = getNextSibling(); while (el != null) { OMElement omel = (OMElement)el; if (omel.getQName().equals(qname)) return (T)getWrapped((Element)omel); el = el.getNextSibling(); } return null; }
protected OMElement _create(OMElement src) { OMElement el = null; FOMFactory fomfactory = (FOMFactory)factory; Object obj = null; if (src instanceof Content) obj = ((Content)src).getContentType(); if (src instanceof Text) obj = ((Text)src).getTextType(); el = fomfactory.createElement(src.getQName(), (OMContainer)fomfactory.newDocument(), factory, obj); return el; }