private void addNamespaceToMap(OMNamespace ns, Map<String,String> map) { if (map.get(ns.getPrefix()) == null) { map.put(ns.getPrefix(), ns.getNamespaceURI()); } }
/** * Retrieves the string-value of a namespace node. This is generally the namespace URI. This may * be the empty string but must not be null. * * @param object the namespace node * @return Returns the string-value of the node. */ public String getNamespaceStringValue(Object object) { return ((OMNamespace) object).getNamespaceURI(); }
/** * Retrieves the namespace prefix of a namespace node. * * @param object the namespace node * @return Returns the prefix associated with the node. */ public String getNamespacePrefix(Object object) { return ((OMNamespace) object).getPrefix(); }
/** * Return true if the SOAP header is an addressing header * @param headerBlock SOAP header block to be checked * @return true if the SOAP header is an addressing header */ private static boolean isAddressingHeader(SOAPHeaderBlock headerBlock) { OMNamespace ns = headerBlock.getNamespace(); return ns != null && ( AddressingConstants.Submission.WSA_NAMESPACE.equals(ns.getNamespaceURI()) || AddressingConstants.Final.WSA_NAMESPACE.equals(ns.getNamespaceURI())); }
public String getPrefix() { if (!element.isExpanded()) { element.forceExpand(); } OMNamespace actualNS = element.getNamespace(); return actualNS == null ? "" : actualNS.getPrefix(); }
public boolean equals(Object obj) { if (!(obj instanceof OMNamespace)) return false; OMNamespace other = (OMNamespace)obj; String otherPrefix = other.getPrefix(); return (uri.equals(other.getNamespaceURI()) && (prefix == null ? otherPrefix == null : prefix.equals(otherPrefix))); }
String getNamespaceURI(String prefix) { if (currentEvent == START_ELEMENT || currentEvent == END_ELEMENT) { if (node instanceof OMElement) { OMNamespace namespaceURI = ((OMElement) node).findNamespaceURI(prefix); return namespaceURI != null ? namespaceURI.getNamespaceURI() : null; } } return null; }
public final OMText createOMText(OMContainer parent, QName text, int type) { if (text == null) { throw new IllegalArgumentException("QName text arg cannot be null!"); } OMNamespace ns = ((AxiomElement)parent).handleNamespace(text.getNamespaceURI(), text.getPrefix()); return createAxiomText(parent, ns == null ? text.getLocalPart() : ns.getPrefix() + ":" + text.getLocalPart(), type, false); }
public boolean equals(Object obj) { if (!(obj instanceof OMNamespace)) return false; OMNamespace other = (OMNamespace)obj; String otherPrefix = other.getPrefix(); return (uri.equals(other.getNamespaceURI()) && (prefix == null ? otherPrefix == null : prefix.equals(otherPrefix))); }
public List<QName> getExtensionAttributes() { List<QName> list = new ArrayList<QName>(); for (Iterator i = getAllAttributes(); i.hasNext();) { OMAttribute attr = (OMAttribute)i.next(); String namespace = (attr.getNamespace() != null) ? attr.getNamespace().getNamespaceURI() : ""; if (!namespace.equals(getNamespace().getNamespaceURI()) && !namespace.equals("")) list.add(attr.getQName()); } return Collections.unmodifiableList(list); }
public boolean removeNamespaceDeclaration(String prefix) { for (Iterator<OMNamespace> it = omTarget.getAllDeclaredNamespaces(); it.hasNext(); ) { if (it.next().getPrefix().equals(prefix)) { it.remove(); return true; } } return false; }
public boolean equals(Object obj) { if (!(obj instanceof OMNamespace)) return false; OMNamespace other = (OMNamespace)obj; String otherPrefix = other.getPrefix(); return (nsUri.equals(other.getNamespaceURI()) && (nsPrefix == null ? otherPrefix == null : nsPrefix.equals(otherPrefix))); }
private SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } } }
public boolean equals(Object obj) { if (!(obj instanceof OMNamespace)) { return false; } OMNamespace other = (OMNamespace)obj; String otherPrefix = other.getPrefix(); String thisPrefix = getPrefix(); return (uri.equals(other.getNamespaceURI()) && (thisPrefix == null ? otherPrefix == null : thisPrefix.equals(otherPrefix))); } }
public SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } }
private java.util.Map<String, String> getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { final java.util.Map<String, String> returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); } return returnMap; }
public QName getQName(OMElement s) { if (s.getNamespace() == null) { return new QName(s.getLocalName()); } return new QName(s.getNamespace().getNamespaceURI(), s.getLocalName()); } public Map<QName, String> getAttributes(OMElement s) {
private java.util.Map<String, String> getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { final java.util.Map<String, String> returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); } return returnMap; }
@Override public Object wrap(OMElement template, OMElement os) { OMElement wrapper; if (os != null) { OMNamespace ns = os.declareNamespace(template.getNamespace().getNamespaceURI(), ""); wrapper = factory.createOMElement(template.getLocalName(), ns); wrapper.addChild(os); } else { wrapper = template.cloneOMElement(); } return wrapper; }
/** * A utility method that copies the namepaces from the SOAPEnvelope */ private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { final java.util.Map returnMap = new java.util.HashMap(); final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); } return returnMap; }