A set of 0 or more names, with no duplicates.
A namespace contains
Name objects. Each name usually corresponds to the name of a
type. The namespace uri of each name (
Namespace#getURI() is the same as the uri of the
Namespace object containing it (
#getURI().
//create namespace for gml
Namespace namespace = new NamespaceImpl( "http://www.opengis.net/gml" );
//add some names
namespace.add( new NameImpl( "http://www.opengis.net/gml", "PointType" ) );
namespace.add( new NameImpl( "http://www.opengis.net/gml", "LineStringType" ) );
namespace.add( new NameImpl( "http://www.opengis.net/gml", "PolygonType" ) );
namespace.add( new NameImpl( "http://www.opengis.net/gml", "AbstractFeatureType" );
ISO 19103
The ISO 19103 specification asks that we have:
- isGlobal()
- name() - inidicating the name of this namespace
- getNames() - set of names
We have combined these concerns by making this a Set of Names, and we remember the URI of this
namespace.
One allowance ISO_19103 allows for is having a Namespace located inside another namespace. You
may certaintly do this by constructing a facility similar to Schema in which namespaces may be
looked up via a Name with the same URI as the one used here.
We are simply not dictating the lookup mechanism, or a backpointer to a containing namespace
(note the two solutions are in conflict and we would like to offer application the freedom to
back this interface onto a facility such as JNDI used in their own application).