Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/soap/Name.java
38890 views
/*1* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.soap;2627/**28* A representation of an XML name. This interface provides methods for29* getting the local and namespace-qualified names and also for getting the30* prefix associated with the namespace for the name. It is also possible31* to get the URI of the namespace.32* <P>33* The following is an example of a namespace declaration in an element.34* <PRE>35* <wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader">36* </PRE>37* ("xmlns" stands for "XML namespace".)38* The following39* shows what the methods in the <code>Name</code> interface will return.40* <UL>41* <LI><code>getQualifiedName</code> will return "prefix:LocalName" =42* "WOMBAT:GetLastTradePrice"43* <LI><code>getURI</code> will return "http://www.wombat.org/trader"44* <LI><code>getLocalName</code> will return "GetLastTracePrice"45* <LI><code>getPrefix</code> will return "WOMBAT"46* </UL>47* <P>48* XML namespaces are used to disambiguate SOAP identifiers from49* application-specific identifiers.50* <P>51* <code>Name</code> objects are created using the method52* <code>SOAPEnvelope.createName</code>, which has two versions.53* One method creates <code>Name</code> objects with54* a local name, a namespace prefix, and a namespace URI.55* and the second creates <code>Name</code> objects with just a local name.56* The following line of57* code, in which <i>se</i> is a <code>SOAPEnvelope</code> object, creates a new58* <code>Name</code> object with all three.59* <PRE>60* Name name = se.createName("GetLastTradePrice", "WOMBAT",61* "http://www.wombat.org/trader");62* </PRE>63* The following line of code gives an example of how a <code>Name</code> object64* can be used. The variable <i>element</i> is a <code>SOAPElement</code> object.65* This code creates a new <code>SOAPElement</code> object with the given name and66* adds it to <i>element</i>.67* <PRE>68* element.addChildElement(name);69* </PRE>70* <P>71* The <code>Name</code> interface may be deprecated in a future release of SAAJ72* in favor of <code>javax.xml.namespace.QName<code>73* @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName74* @see SOAPFactory#createName(String, String, String) SOAPFactory.createName75*/76public interface Name {77/**78* Gets the local name part of the XML name that this <code>Name</code>79* object represents.80*81* @return a string giving the local name82*/83String getLocalName();8485/**86* Gets the namespace-qualified name of the XML name that this87* <code>Name</code> object represents.88*89* @return the namespace-qualified name as a string90*/91String getQualifiedName();9293/**94* Returns the prefix that was specified when this <code>Name</code> object95* was initialized. This prefix is associated with the namespace for the XML96* name that this <code>Name</code> object represents.97*98* @return the prefix as a string99*/100String getPrefix();101102/**103* Returns the URI of the namespace for the XML104* name that this <code>Name</code> object represents.105*106* @return the URI as a string107*/108String getURI();109}110111112