org.vfny.geoserver.global
Class NameSpaceInfo

java.lang.Object
  extended byorg.vfny.geoserver.global.GlobalLayerSupertype
      extended byorg.vfny.geoserver.global.NameSpaceInfo
All Implemented Interfaces:
org.geotools.data.MetaData, org.geotools.data.NamespaceMetaData

public class NameSpaceInfo
extends org.vfny.geoserver.global.GlobalLayerSupertype
implements org.geotools.data.NamespaceMetaData

NameSpaceInfo purpose.

A representation of a namespace for the Geoserver application.

NameSpaceInfo ns = new NameSpaceInfo(dto); System.out.println(ns.getPrefix() + ns.getUri());


Field Summary
protected static java.util.logging.Logger LOGGER
          for debugging
 
Constructor Summary
NameSpaceInfo(Data data, NameSpaceInfoDTO ns)
          NameSpaceConfig constructor.
NameSpaceInfo(NameSpaceInfo ns)
          NameSpaceConfig constructor.
 
Method Summary
 java.lang.Object clone()
          Implement clone.
 boolean containsMetaData(java.lang.String key)
          Implement containsMetaData.
 boolean equals(java.lang.Object obj)
          Implement equals.
static java.lang.String get(java.util.Map map, java.lang.String key)
          get purpose.
static boolean get(java.util.Map map, java.lang.String key, boolean defaultValue)
          get purpose.
static java.nio.charset.Charset get(java.util.Map map, java.lang.String key, java.nio.charset.Charset defaultCharSet)
          get purpose.
static java.lang.Class get(java.util.Map map, java.lang.String key, java.lang.Class defaultType)
          get purpose.
static java.io.File get(java.util.Map map, java.lang.String key, java.io.File defaultFile)
          get purpose.
static int get(java.util.Map map, java.lang.String key, int defaultValue)
          get purpose.
static java.util.logging.Level get(java.util.Map map, java.lang.String key, java.util.logging.Level defaultLevel)
          get purpose.
static java.util.List get(java.util.Map map, java.lang.String key, java.util.List defaultList)
          get purpose.
static java.util.Map get(java.util.Map map, java.lang.String key, java.util.Map defaultMap)
          get purpose.
static java.lang.String get(java.util.Map map, java.lang.String key, java.lang.String defaultValue)
          get purpose.
static java.net.URL get(java.util.Map map, java.lang.String key, java.net.URL defaultUrl)
          get purpose.
 org.geotools.data.FeatureTypeMetaData getFeatureTypeMetaData(java.lang.String typeName)
          Implement getFeatureTypeMetaData.
 java.lang.Object getMetaData(java.lang.String key)
          Implement getMetaData.
 java.lang.String getPrefix()
          getPrefix purpose.
 java.util.Set getTypeNames()
          This should be a list of available typeNames for the namespace.
 java.lang.String getUri()
          getUri purpose.
 java.lang.String getURI()
          Implement getURI.
 boolean isDefault()
          isDefault purpose.
protected  java.lang.String notNull(java.lang.String s)
          checks s for nullity and if so, returns an empty String, else just returns s
 void putMetaData(java.lang.String key, java.lang.Object value)
          Implement putMetaData.
 void setDefault(boolean b)
          setDdefault purpose.
 void setPrefix(java.lang.String string)
          setPrefix purpose.
 void setUri(java.lang.String string)
          setUri purpose.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

protected static final java.util.logging.Logger LOGGER
for debugging

Constructor Detail

NameSpaceInfo

public NameSpaceInfo(Data data,
                     NameSpaceInfoDTO ns)
NameSpaceConfig constructor.

Creates a NameSpaceConfig based on the data provided. All the data structures are cloned.

Parameters:
data - DOCUMENT ME!
ns - The namespace to copy.
Throws:
java.lang.NullPointerException - when the param is null

NameSpaceInfo

public NameSpaceInfo(NameSpaceInfo ns)
NameSpaceConfig constructor.

Creates a copy of the NameSpaceConfig provided. All the data structures are cloned.

Parameters:
ns - The namespace to copy.
Throws:
java.lang.NullPointerException - when the param is null
Method Detail

clone

public java.lang.Object clone()
Implement clone.

creates a clone of this object

Returns:
A copy of this NameSpaceConfig
See Also:
Object.clone()

equals

public boolean equals(java.lang.Object obj)
Implement equals.

recursively tests to determine if the object passed in is a copy of this object.

Parameters:
obj - The NameSpaceConfig object to test.
Returns:
true when the object passed is the same as this object.
See Also:
Object.equals(java.lang.Object)

isDefault

public boolean isDefault()
isDefault purpose.

Whether this is the default namespace.

Returns:
true when this is the default namespace.

getPrefix

public java.lang.String getPrefix()
getPrefix purpose.

returns the namespace's prefix.

Specified by:
getPrefix in interface org.geotools.data.NamespaceMetaData
Returns:
String the namespace's prefix

getUri

public java.lang.String getUri()
getUri purpose.

returns the namespace's uri.

Returns:
String the namespace's uri.

setDefault

public void setDefault(boolean b)
setDdefault purpose.

sets the default namespace.

Parameters:
b - this is the default namespace.

setPrefix

public void setPrefix(java.lang.String string)
setPrefix purpose.

stores the namespace's prefix.

Parameters:
string - the namespace's prefix.

setUri

public void setUri(java.lang.String string)
setUri purpose.

Stores the namespace's uri.

Parameters:
string - the namespace's uri.

containsMetaData

public boolean containsMetaData(java.lang.String key)
Implement containsMetaData.

Specified by:
containsMetaData in interface org.geotools.data.MetaData
Parameters:
key -
Returns:
See Also:
MetaData.containsMetaData(java.lang.String)

putMetaData

public void putMetaData(java.lang.String key,
                        java.lang.Object value)
Implement putMetaData.

Specified by:
putMetaData in interface org.geotools.data.MetaData
Parameters:
key -
value -
See Also:
MetaData.putMetaData(java.lang.String, java.lang.Object)

getMetaData

public java.lang.Object getMetaData(java.lang.String key)
Implement getMetaData.

Specified by:
getMetaData in interface org.geotools.data.MetaData
Parameters:
key -
Returns:
See Also:
MetaData.getMetaData(java.lang.String)

getURI

public java.lang.String getURI()
Implement getURI.

Description ...

Specified by:
getURI in interface org.geotools.data.NamespaceMetaData
Returns:
See Also:
NamespaceMetaData.getURI()

getTypeNames

public java.util.Set getTypeNames()
This should be a list of available typeNames for the namespace.

Makes use of data to get the list of all FeatureTypes, returns the names that match this prefix. This is just the typeName and not the full prefix:typeName.

Specified by:
getTypeNames in interface org.geotools.data.NamespaceMetaData
Returns:
See Also:
NamespaceMetaData.getTypeNames()

getFeatureTypeMetaData

public org.geotools.data.FeatureTypeMetaData getFeatureTypeMetaData(java.lang.String typeName)
Implement getFeatureTypeMetaData.

Description ...

Specified by:
getFeatureTypeMetaData in interface org.geotools.data.NamespaceMetaData
Parameters:
typeName -
Returns:
See Also:
NamespaceMetaData.getFeatureTypeMetaData(java.lang.String)

toString

public java.lang.String toString()

notNull

protected java.lang.String notNull(java.lang.String s)
checks s for nullity and if so, returns an empty String, else just returns s

Parameters:
s - String
Returns:
String non-null String (null -> "")

get

public static java.lang.String get(java.util.Map map,
                                   java.lang.String key)
get purpose.

Gets a String from a map of Strings

Parameters:
map - Map the map to extract the string from
key - String the key for the map.
Returns:
String the value in the map.
See Also:
Map

get

public static java.io.File get(java.util.Map map,
                               java.lang.String key,
                               java.io.File defaultFile)
get purpose.

Gets a File from a map given the specified key. If the file is not found the default file is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultFile - The default value should the key not exist.
Returns:
File a File as described above.

get

public static java.lang.String get(java.util.Map map,
                                   java.lang.String key,
                                   java.lang.String defaultValue)
get purpose.

Gets a String from a map of Strings, and returns the default if the string does not exist.

Parameters:
map - Map the map to extract the string from
key - String the key for the map.
defaultValue - The default value should the key not exist.
Returns:
String the value in the map.
See Also:
Map

get

public static java.util.List get(java.util.Map map,
                                 java.lang.String key,
                                 java.util.List defaultList)
get purpose.

Gets a List from a map given the specified key. If the list is not found the default list is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultList - The default value should the key not exist.
Returns:
List a List as described above.

get

public static java.util.Map get(java.util.Map map,
                                java.lang.String key,
                                java.util.Map defaultMap)
get purpose.

Gets a Map from a map given the specified key. If the map is not found the default map is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultMap - The default value should the key not exist.
Returns:
Map a Map as described above.

get

public static int get(java.util.Map map,
                      java.lang.String key,
                      int defaultValue)
get purpose.

Gets a int from a map given the specified key. If the int is not found the default int is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultValue - The default value should the key not exist.
Returns:
int an int as described above.

get

public static boolean get(java.util.Map map,
                          java.lang.String key,
                          boolean defaultValue)
get purpose.

Gets a boolean from a map given the specified key. If the boolean is not found the default boolean is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultValue - The default value should the key not exist.
Returns:
boolean an boolean as described above.

get

public static java.nio.charset.Charset get(java.util.Map map,
                                           java.lang.String key,
                                           java.nio.charset.Charset defaultCharSet)
get purpose.

Gets a Charset from a map given the specified key. If the Charset is not found the default Charset is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultCharSet - The default value should the key not exist.
Returns:
Charset an boolean as described above.

get

public static java.util.logging.Level get(java.util.Map map,
                                          java.lang.String key,
                                          java.util.logging.Level defaultLevel)
get purpose.

Gets a Level from a map given the specified key. If the Level is not found the default Level is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultLevel - The default value should the key not exist.
Returns:
Level an boolean as described above.

get

public static java.net.URL get(java.util.Map map,
                               java.lang.String key,
                               java.net.URL defaultUrl)
get purpose.

Gets a URL from a map given the specified key. If the URL is not found the default URL is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultUrl - The default value should the key not exist.
Returns:
URL an boolean as described above.

get

public static java.lang.Class get(java.util.Map map,
                                  java.lang.String key,
                                  java.lang.Class defaultType)
get purpose.

Gets a Class from a map given the specified key. If the Class is not found the default Class is returned.

Parameters:
map - Map the map to extract the file from
key - String the key to extract the value for
defaultType - The default value should the key not exist.
Returns:
Class an boolean as described above.