org.apache.anteater.test
Class Namespace

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.types.DataType
              |
              +--org.apache.anteater.test.BaseDataType
                    |
                    +--org.apache.anteater.test.Namespace
All Implemented Interfaces:
Groupable

public class Namespace
extends BaseDataType

Anteater representation of an XML namespace mapping. Models what would usually be stored in XML as an attribute, xmlns:prefix="url". Ant does not make namespace information available to tasks, so we have to store this info as a separate element.

Since:
August 5, 2002
Version:
$Revision: 1.2 $ $Date: 2002/12/11 05:53:54 $
Author:
Jeff Turner

Field Summary
protected  String _prefix
           
protected  String _uri
           
 
Fields inherited from class org.apache.anteater.test.BaseDataType
debug, debugWasSet
 
Fields inherited from class org.apache.tools.ant.types.DataType
checked, description, ref
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
Namespace()
          No-arg constructor needed by Ant.
 
Method Summary
static Namespace create(org.apache.tools.ant.Project proj, String prefix, String uri)
          A factory for creating Namespaces which have their 'project' field properly set.
 String getPrefix()
          Get the XML namespace prefix.
 String getURI()
          Get the XML namespace URI.
 void setPrefix(String prefix)
          Set the XML namespace prefix.
 void setURI(String uri)
          Set the XML namespace URI.
 String toString()
          Debugging representation of the ns mapping.
 
Methods inherited from class org.apache.anteater.test.BaseDataType
debug, getDataTypeName, getDebug, getGroup, getRef, print, println, setDebug, setGroup, setGroup, setRefid
 
Methods inherited from class org.apache.tools.ant.types.DataType
circularReference, dieOnCircularReference, getCheckedRef, getDescription, isReference, noChildrenAllowed, setDescription, tooManyAttributes
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, log, log, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_prefix

protected String _prefix

_uri

protected String _uri
Constructor Detail

Namespace

public Namespace()
No-arg constructor needed by Ant.

Method Detail

create

public static Namespace create(org.apache.tools.ant.Project proj,
                               String prefix,
                               String uri)
A factory for creating Namespaces which have their 'project' field properly set.


setPrefix

public void setPrefix(String prefix)
Set the XML namespace prefix. This prefix is used in, eg the XPath task.


setURI

public void setURI(String uri)
Set the XML namespace URI.


getPrefix

public String getPrefix()
Get the XML namespace prefix.

Returns:
the prefix, or null if not set.

getURI

public String getURI()
Get the XML namespace URI.

Returns:
the URI, or null if not set.

toString

public String toString()
Debugging representation of the ns mapping.

Overrides:
toString in class Object
Returns:
String of the form prefix -> uri


Ant Functional Tester -- see Project home page for details