aoqi@0: /* aoqi@0: * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package javax.xml.soap; aoqi@0: aoqi@0: /** aoqi@0: * A representation of an XML name. This interface provides methods for aoqi@0: * getting the local and namespace-qualified names and also for getting the aoqi@0: * prefix associated with the namespace for the name. It is also possible aoqi@0: * to get the URI of the namespace. aoqi@0: *
aoqi@0: * The following is an example of a namespace declaration in an element. aoqi@0: *
aoqi@0: * <wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader"> aoqi@0: *aoqi@0: * ("xmlns" stands for "XML namespace".) aoqi@0: * The following aoqi@0: * shows what the methods in the
Name
interface will return.
aoqi@0: * getQualifiedName
will return "prefix:LocalName" =
aoqi@0: * "WOMBAT:GetLastTradePrice"
aoqi@0: * getURI
will return "http://www.wombat.org/trader"
aoqi@0: * getLocalName
will return "GetLastTracePrice"
aoqi@0: * getPrefix
will return "WOMBAT"
aoqi@0: * aoqi@0: * XML namespaces are used to disambiguate SOAP identifiers from aoqi@0: * application-specific identifiers. aoqi@0: *
aoqi@0: * Name
objects are created using the method
aoqi@0: * SOAPEnvelope.createName
, which has two versions.
aoqi@0: * One method creates Name
objects with
aoqi@0: * a local name, a namespace prefix, and a namespace URI.
aoqi@0: * and the second creates Name
objects with just a local name.
aoqi@0: * The following line of
aoqi@0: * code, in which se is a SOAPEnvelope
object, creates a new
aoqi@0: * Name
object with all three.
aoqi@0: *
aoqi@0: * Name name = se.createName("GetLastTradePrice", "WOMBAT", aoqi@0: * "http://www.wombat.org/trader"); aoqi@0: *aoqi@0: * The following line of code gives an example of how a
Name
object
aoqi@0: * can be used. The variable element is a SOAPElement
object.
aoqi@0: * This code creates a new SOAPElement
object with the given name and
aoqi@0: * adds it to element.
aoqi@0: * aoqi@0: * element.addChildElement(name); aoqi@0: *aoqi@0: *
aoqi@0: * The Name
interface may be deprecated in a future release of SAAJ
aoqi@0: * in favor of javax.xml.namespace.QName
aoqi@0: * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName
aoqi@0: * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName
aoqi@0: */
aoqi@0: public interface Name {
aoqi@0: /**
aoqi@0: * Gets the local name part of the XML name that this
Name
aoqi@0: * object represents.
aoqi@0: *
aoqi@0: * @return a string giving the local name
aoqi@0: */
aoqi@0: String getLocalName();
aoqi@0:
aoqi@0: /**
aoqi@0: * Gets the namespace-qualified name of the XML name that this
aoqi@0: * Name
object represents.
aoqi@0: *
aoqi@0: * @return the namespace-qualified name as a string
aoqi@0: */
aoqi@0: String getQualifiedName();
aoqi@0:
aoqi@0: /**
aoqi@0: * Returns the prefix that was specified when this Name
object
aoqi@0: * was initialized. This prefix is associated with the namespace for the XML
aoqi@0: * name that this Name
object represents.
aoqi@0: *
aoqi@0: * @return the prefix as a string
aoqi@0: */
aoqi@0: String getPrefix();
aoqi@0:
aoqi@0: /**
aoqi@0: * Returns the URI of the namespace for the XML
aoqi@0: * name that this Name
object represents.
aoqi@0: *
aoqi@0: * @return the URI as a string
aoqi@0: */
aoqi@0: String getURI();
aoqi@0: }