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