1 /*
2 * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
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
38 * shows what the methods in the {@code Name} interface will return.
39 * <UL>
40 * <LI>{@code getQualifiedName} will return "prefix:LocalName" =
41 * "WOMBAT:GetLastTradePrice"
42 * <LI>{@code getURI} will return "http://www.wombat.org/trader"
43 * <LI>{@code getLocalName} will return "GetLastTracePrice"
44 * <LI>{@code getPrefix} will return "WOMBAT"
45 * </UL>
46 * <P>
47 * XML namespaces are used to disambiguate SOAP identifiers from
48 * application-specific identifiers.
49 * <P>
50 * {@code Name} objects are created using the method
51 * {@code SOAPEnvelope.createName}, which has two versions.
52 * One method creates {@code Name} objects with
53 * a local name, a namespace prefix, and a namespace URI.
54 * and the second creates {@code Name} objects with just a local name.
55 * The following line of
56 * code, in which <i>se</i> is a {@code SOAPEnvelope} object, creates a new
57 * {@code Name} object with all three.
58 * <PRE>
59 * Name name = se.createName("GetLastTradePrice", "WOMBAT",
60 * "http://www.wombat.org/trader");
61 * </PRE>
62 * The following line of code gives an example of how a {@code Name} object
63 * can be used. The variable <i>element</i> is a {@code SOAPElement} object.
64 * This code creates a new {@code SOAPElement} object with the given name and
65 * adds it to <i>element</i>.
66 * <PRE>
67 * element.addChildElement(name);
68 * </PRE>
69 * <P>
70 * The {@code Name} interface may be deprecated in a future release of SAAJ
71 * in favor of {@code javax.xml.namespace.QName}
72 * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName
73 * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName
74 * @since 1.6
75 */
76 public interface Name {
77 /**
78 * Gets the local name part of the XML name that this {@code Name}
79 * object represents.
80 *
81 * @return a string giving the local name
82 */
83 String getLocalName();
84
85 /**
86 * Gets the namespace-qualified name of the XML name that this
87 * {@code Name} object represents.
88 *
|
1 /*
2 * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
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
38 * shows what the methods in the {@code Name} interface will return.
39 * <UL>
40 * <LI>{@code getQualifiedName} will return "prefix:LocalName" =
41 * "WOMBAT:GetLastTradePrice"
42 * <LI>{@code getURI} will return "http://www.wombat.org/trader"
43 * <LI>{@code getLocalName} will return "GetLastTracePrice"
44 * <LI>{@code getPrefix} will return "WOMBAT"
45 * </UL>
46 * <P>
47 * XML namespaces are used to disambiguate SOAP identifiers from
48 * application-specific identifiers.
49 * <P>
50 * {@code Name} objects are created using the method
51 * {@code SOAPEnvelope.createName}, which has two versions.
52 * One method creates {@code Name} objects with
53 * a local name, a namespace prefix, and a namespace URI.
54 * and the second creates {@code Name} objects with just a local name.
55 * The following line of
56 * code, in which <i>se</i> is a {@code SOAPEnvelope} object, creates a new
57 * {@code Name} object with all three.
58 * {@code
59 * Name name = se.createName("GetLastTradePrice", "WOMBAT",
60 * "http://www.wombat.org/trader");
61 * }
62 * The following line of code gives an example of how a {@code Name} object
63 * can be used. The variable <i>element</i> is a {@code SOAPElement} object.
64 * This code creates a new {@code SOAPElement} object with the given name and
65 * adds it to <i>element</i>.
66 * {@code
67 * element.addChildElement(name);
68 * }
69 * <P>
70 * The {@code Name} interface may be deprecated in a future release of SAAJ
71 * in favor of {@code javax.xml.namespace.QName}
72 * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName
73 * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName
74 * @since 1.6
75 */
76 public interface Name {
77 /**
78 * Gets the local name part of the XML name that this {@code Name}
79 * object represents.
80 *
81 * @return a string giving the local name
82 */
83 String getLocalName();
84
85 /**
86 * Gets the namespace-qualified name of the XML name that this
87 * {@code Name} object represents.
88 *
|