1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/jaxws_classes/javax/xml/soap/Name.java Tue Mar 06 16:09:35 2012 -0800 1.3 @@ -0,0 +1,110 @@ 1.4 +/* 1.5 + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +package javax.xml.soap; 1.30 + 1.31 +/** 1.32 + * A representation of an XML name. This interface provides methods for 1.33 + * getting the local and namespace-qualified names and also for getting the 1.34 + * prefix associated with the namespace for the name. It is also possible 1.35 + * to get the URI of the namespace. 1.36 + * <P> 1.37 + * The following is an example of a namespace declaration in an element. 1.38 + * <PRE> 1.39 + * <wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader"> 1.40 + * </PRE> 1.41 + * ("xmlns" stands for "XML namespace".) 1.42 + * The following 1.43 + * shows what the methods in the <code>Name</code> interface will return. 1.44 + * <UL> 1.45 + * <LI><code>getQualifiedName</code> will return "prefix:LocalName" = 1.46 + * "WOMBAT:GetLastTradePrice" 1.47 + * <LI><code>getURI</code> will return "http://www.wombat.org/trader" 1.48 + * <LI><code>getLocalName</code> will return "GetLastTracePrice" 1.49 + * <LI><code>getPrefix</code> will return "WOMBAT" 1.50 + * </UL> 1.51 + * <P> 1.52 + * XML namespaces are used to disambiguate SOAP identifiers from 1.53 + * application-specific identifiers. 1.54 + * <P> 1.55 + * <code>Name</code> objects are created using the method 1.56 + * <code>SOAPEnvelope.createName</code>, which has two versions. 1.57 + * One method creates <code>Name</code> objects with 1.58 + * a local name, a namespace prefix, and a namespace URI. 1.59 + * and the second creates <code>Name</code> objects with just a local name. 1.60 + * The following line of 1.61 + * code, in which <i>se</i> is a <code>SOAPEnvelope</code> object, creates a new 1.62 + * <code>Name</code> object with all three. 1.63 + * <PRE> 1.64 + * Name name = se.createName("GetLastTradePrice", "WOMBAT", 1.65 + * "http://www.wombat.org/trader"); 1.66 + * </PRE> 1.67 + * The following line of code gives an example of how a <code>Name</code> object 1.68 + * can be used. The variable <i>element</i> is a <code>SOAPElement</code> object. 1.69 + * This code creates a new <code>SOAPElement</code> object with the given name and 1.70 + * adds it to <i>element</i>. 1.71 + * <PRE> 1.72 + * element.addChildElement(name); 1.73 + * </PRE> 1.74 + * <P> 1.75 + * The <code>Name</code> interface may be deprecated in a future release of SAAJ 1.76 + * in favor of <code>javax.xml.namespace.QName<code> 1.77 + * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName 1.78 + * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName 1.79 + */ 1.80 +public interface Name { 1.81 + /** 1.82 + * Gets the local name part of the XML name that this <code>Name</code> 1.83 + * object represents. 1.84 + * 1.85 + * @return a string giving the local name 1.86 + */ 1.87 + String getLocalName(); 1.88 + 1.89 + /** 1.90 + * Gets the namespace-qualified name of the XML name that this 1.91 + * <code>Name</code> object represents. 1.92 + * 1.93 + * @return the namespace-qualified name as a string 1.94 + */ 1.95 + String getQualifiedName(); 1.96 + 1.97 + /** 1.98 + * Returns the prefix that was specified when this <code>Name</code> object 1.99 + * was initialized. This prefix is associated with the namespace for the XML 1.100 + * name that this <code>Name</code> object represents. 1.101 + * 1.102 + * @return the prefix as a string 1.103 + */ 1.104 + String getPrefix(); 1.105 + 1.106 + /** 1.107 + * Returns the URI of the namespace for the XML 1.108 + * name that this <code>Name</code> object represents. 1.109 + * 1.110 + * @return the URI as a string 1.111 + */ 1.112 + String getURI(); 1.113 +}