All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.axis.message.addressing.AttributedQName Maven / Gradle / Ivy

/*
 *  Copyright (c) 2008 Rodrigo Ruiz
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.apache.axis.message.addressing;

import javax.xml.namespace.QName;

import org.apache.axis.message.addressing.util.AddressingUtils;
import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * Java content class for AttributedQName complex type.
 * 

* The following schema fragment specifies the expected content contained within * this java content object. (defined at * http://schemas.xmlsoap.org/ws/2004/08/addressing line 98) * *

 * <complexType name="AttributedQName">
 *   <simpleContent>
 *     <extension base="<http://www.w3.org/2001/XMLSchema>QName">
 *     </extension>
 *   </simpleContent>
 * </complexType>
 * 
* * @author Davanum Srinivas * @author Rodrigo Ruiz * @version $Revision: 14 $ */ public class AttributedQName extends QName implements DOMAppendable { /** * serialVersionUID attribute. */ private static final long serialVersionUID = 4575840707201336233L; /** * Constructor AttributedQName. * * @param qname Qualified name */ public AttributedQName(QName qname) { super(qname.getNamespaceURI(), qname.getLocalPart(), qname.getPrefix()); } /** * Constructor AttributedQName. * * @param namespace name space * @param localPart local name */ public AttributedQName(String namespace, String localPart) { super(namespace, localPart); } /** * {@inheritDoc} */ public final void append(Element parent, String elementName) { append(AddressingUtils.getAddressingVersion(), parent, elementName); } /** * {@inheritDoc} */ public void append(AddressingVersion version, Element parent, String elementName) { Document doc = parent.getOwnerDocument(); Element pt = doc.createElementNS(version.getNamespace(), elementName); String value = XMLUtils.getStringForQName(this, pt); pt.appendChild(doc.createTextNode(value)); parent.appendChild(pt); } /** * {@inheritDoc} */ public void append(Element parent) { append(parent, "qname"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy