Interface Namespace

  • All Superinterfaces:
    Collection<Name>, Iterable<Name>, Set<Name>

    public interface Namespace
    extends Set<Name>
    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 (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).

    Since:
    GeoAPI 2.1
    Author:
    Jody Garnett, Refractions Research, Inc., Justin Deoliveira, The Open Planning Project
    • Method Detail

      • getURI

        String getURI()
        The namespace uri of this namespace.

        This value can never be null.

      • lookup

        Name lookup​(String name)
        Looks up a name in the namespace.

        Since all Name objects in the namespace share the same uri as the namespace itself, only the local part of the name is specified.

        This method returns null if no such name exists.

        Parameters:
        name - The local part of the name to look up.
        Returns:
        The name, or null.