src/share/jaxws_classes/javax/xml/soap/Name.java

Tue, 09 Apr 2013 14:51:13 +0100

author
alanb
date
Tue, 09 Apr 2013 14:51:13 +0100
changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
permissions
-rw-r--r--

8010393: Update JAX-WS RI to 2.2.9-b12941
Reviewed-by: alanb, erikj
Contributed-by: miroslav.kos@oracle.com, martin.grebac@oracle.com

ohair@286 1 /*
alanb@368 2 * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 package javax.xml.soap;
ohair@286 27
ohair@286 28 /**
ohair@286 29 * A representation of an XML name. This interface provides methods for
ohair@286 30 * getting the local and namespace-qualified names and also for getting the
ohair@286 31 * prefix associated with the namespace for the name. It is also possible
ohair@286 32 * to get the URI of the namespace.
ohair@286 33 * <P>
ohair@286 34 * The following is an example of a namespace declaration in an element.
ohair@286 35 * <PRE>
ohair@286 36 * &lt;wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader"&gt;
ohair@286 37 * </PRE>
ohair@286 38 * ("xmlns" stands for "XML namespace".)
ohair@286 39 * The following
ohair@286 40 * shows what the methods in the <code>Name</code> interface will return.
ohair@286 41 * <UL>
ohair@286 42 * <LI><code>getQualifiedName</code> will return "prefix:LocalName" =
ohair@286 43 * "WOMBAT:GetLastTradePrice"
ohair@286 44 * <LI><code>getURI</code> will return "http://www.wombat.org/trader"
ohair@286 45 * <LI><code>getLocalName</code> will return "GetLastTracePrice"
ohair@286 46 * <LI><code>getPrefix</code> will return "WOMBAT"
ohair@286 47 * </UL>
ohair@286 48 * <P>
ohair@286 49 * XML namespaces are used to disambiguate SOAP identifiers from
ohair@286 50 * application-specific identifiers.
ohair@286 51 * <P>
ohair@286 52 * <code>Name</code> objects are created using the method
ohair@286 53 * <code>SOAPEnvelope.createName</code>, which has two versions.
ohair@286 54 * One method creates <code>Name</code> objects with
ohair@286 55 * a local name, a namespace prefix, and a namespace URI.
ohair@286 56 * and the second creates <code>Name</code> objects with just a local name.
ohair@286 57 * The following line of
ohair@286 58 * code, in which <i>se</i> is a <code>SOAPEnvelope</code> object, creates a new
ohair@286 59 * <code>Name</code> object with all three.
ohair@286 60 * <PRE>
ohair@286 61 * Name name = se.createName("GetLastTradePrice", "WOMBAT",
ohair@286 62 * "http://www.wombat.org/trader");
ohair@286 63 * </PRE>
ohair@286 64 * The following line of code gives an example of how a <code>Name</code> object
ohair@286 65 * can be used. The variable <i>element</i> is a <code>SOAPElement</code> object.
ohair@286 66 * This code creates a new <code>SOAPElement</code> object with the given name and
ohair@286 67 * adds it to <i>element</i>.
ohair@286 68 * <PRE>
ohair@286 69 * element.addChildElement(name);
ohair@286 70 * </PRE>
ohair@286 71 * <P>
ohair@286 72 * The <code>Name</code> interface may be deprecated in a future release of SAAJ
ohair@286 73 * in favor of <code>javax.xml.namespace.QName<code>
ohair@286 74 * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName
ohair@286 75 * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName
ohair@286 76 */
ohair@286 77 public interface Name {
ohair@286 78 /**
ohair@286 79 * Gets the local name part of the XML name that this <code>Name</code>
ohair@286 80 * object represents.
ohair@286 81 *
ohair@286 82 * @return a string giving the local name
ohair@286 83 */
ohair@286 84 String getLocalName();
ohair@286 85
ohair@286 86 /**
ohair@286 87 * Gets the namespace-qualified name of the XML name that this
ohair@286 88 * <code>Name</code> object represents.
ohair@286 89 *
ohair@286 90 * @return the namespace-qualified name as a string
ohair@286 91 */
ohair@286 92 String getQualifiedName();
ohair@286 93
ohair@286 94 /**
ohair@286 95 * Returns the prefix that was specified when this <code>Name</code> object
ohair@286 96 * was initialized. This prefix is associated with the namespace for the XML
ohair@286 97 * name that this <code>Name</code> object represents.
ohair@286 98 *
ohair@286 99 * @return the prefix as a string
ohair@286 100 */
ohair@286 101 String getPrefix();
ohair@286 102
ohair@286 103 /**
ohair@286 104 * Returns the URI of the namespace for the XML
ohair@286 105 * name that this <code>Name</code> object represents.
ohair@286 106 *
ohair@286 107 * @return the URI as a string
ohair@286 108 */
ohair@286 109 String getURI();
ohair@286 110 }

mercurial