blob: 973461bdf251e7577304aea46a15f974533d9e2e [file] [log] [blame]
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package javax.xml.soap;
/**
* A representation of an XML name. This interface provides methods for
* getting the local and namespace-qualified names and also for getting the
* prefix associated with the namespace for the name. It is also possible
* to get the URI of the namespace.
* <P>
* The following is an example of a namespace declaration in an element.
* <PRE>
* &lt;wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader"&gt;
* </PRE>
* ("xmlns" stands for "XML namespace".)
* The following
* shows what the methods in the <code>Name</code> interface will return.
* <UL>
* <LI><code>getQualifiedName</code> will return "prefix:LocalName" =
* "WOMBAT:GetLastTradePrice"
* <LI><code>getURI</code> will return "http://www.wombat.org/trader"
* <LI><code>getLocalName</code> will return "GetLastTracePrice"
* <LI><code>getPrefix</code> will return "WOMBAT"
* </UL>
* <P>
* XML namespaces are used to disambiguate SOAP identifiers from
* application-specific identifiers.
* <P>
* <code>Name</code> objects are created using the method
* <code>SOAPEnvelope.createName</code>, which has two versions.
* One method creates <code>Name</code> objects with
* a local name, a namespace prefix, and a namespace URI.
* and the second creates <code>Name</code> objects with just a local name.
* The following line of
* code, in which <i>se</i> is a <code>SOAPEnvelope</code> object, creates a new
* <code>Name</code> object with all three.
* <PRE>
* Name name = se.createName("GetLastTradePrice", "WOMBAT",
* "http://www.wombat.org/trader");
* </PRE>
* The following line of code gives an example of how a <code>Name</code> object
* can be used. The variable <i>element</i> is a <code>SOAPElement</code> object.
* This code creates a new <code>SOAPElement</code> object with the given name and
* adds it to <i>element</i>.
* <PRE>
* element.addChildElement(name);
* </PRE>
*/
public interface Name {
/**
* Gets the local name part of the XML name that this <code>Name</code>
* object represents.
* @return a string giving the local name
*/
public abstract String getLocalName();
/**
* Gets the namespace-qualified name of the XML name that this
* <code>Name</code> object represents.
* @return the namespace-qualified name as a string
*/
public abstract String getQualifiedName();
/**
* Returns the prefix associated with the namespace for the XML
* name that this <code>Name</code> object represents.
* @return the prefix as a string
*/
public abstract String getPrefix();
/**
* Returns the URI of the namespace for the XML
* name that this <code>Name</code> object represents.
* @return the URI as a string
*/
public abstract String getURI();
}