org.geotools.data
Class DataStoreFactorySpi.Param

java.lang.Object
  extended byorg.geotools.data.DataStoreFactorySpi.Param
Enclosing class:
DataStoreFactorySpi

public static class DataStoreFactorySpi.Param
extends java.lang.Object

Data class used to capture Parameter requirements.

Subclasses may provide specific setAsText()/getAsText() requirements

Warning: We would like to start moving towards a common paraemters framework with GridCoverageExchnage. Param will be maintained as a wrapper for one point release (at which time it will be deprecated).


Field Summary
 java.lang.String description
          Short description (less then 40 characters)
 java.lang.String key
          Key used in Parameter map
 boolean required
          True if Param is required
 java.lang.Object sample
          Sampel value provided as an example for user input.
 java.lang.Class type
          Type of information required
 
Constructor Summary
DataStoreFactorySpi.Param(java.lang.String key)
          Provides support for text representations The parameter type of String is assumed.
DataStoreFactorySpi.Param(java.lang.String key, java.lang.Class type)
          Provides support for text representations.
DataStoreFactorySpi.Param(java.lang.String key, java.lang.Class type, java.lang.String description)
          Provides support for text representations
DataStoreFactorySpi.Param(java.lang.String key, java.lang.Class type, java.lang.String description, boolean required)
          Provides support for text representations
DataStoreFactorySpi.Param(java.lang.String key, java.lang.Class type, java.lang.String description, boolean required, java.lang.Object sample)
          Provides support for text representations
 
Method Summary
 java.lang.Object handle(java.lang.String text)
          Handle text in a sensible manner.
 java.lang.Object lookUp(java.util.Map map)
          Lookup Param in a user supplied map.
 java.lang.Object parse(java.lang.String text)
          Provides support for text representations Provides basic support for common types using reflection.
 java.lang.String text(java.lang.Object value)
          Convert value to text representation for this Parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

required

public final boolean required
True if Param is required


key

public final java.lang.String key
Key used in Parameter map


type

public final java.lang.Class type
Type of information required


description

public final java.lang.String description
Short description (less then 40 characters)


sample

public final java.lang.Object sample
Sampel value provided as an example for user input.

May be passed to getAsText( sample ) for inital text based user interface default.

Constructor Detail

DataStoreFactorySpi.Param

public DataStoreFactorySpi.Param(java.lang.String key)
Provides support for text representations

The parameter type of String is assumed.

Parameters:
key - Key used to file this Param in the Parameter Map for createDataStore

DataStoreFactorySpi.Param

public DataStoreFactorySpi.Param(java.lang.String key,
                                 java.lang.Class type)
Provides support for text representations.

You may specify a type for this Param.

Parameters:
key - Key used to file this Param in the Parameter Map for createDataStore
type - Class type intended for this Param

DataStoreFactorySpi.Param

public DataStoreFactorySpi.Param(java.lang.String key,
                                 java.lang.Class type,
                                 java.lang.String description)
Provides support for text representations

Parameters:
key - Key used to file this Param in the Parameter Map for createDataStore
type - Class type intended for this Param
description - User description of Param (40 chars or less)

DataStoreFactorySpi.Param

public DataStoreFactorySpi.Param(java.lang.String key,
                                 java.lang.Class type,
                                 java.lang.String description,
                                 boolean required)
Provides support for text representations

Parameters:
key - Key used to file this Param in the Parameter Map for createDataStore
type - Class type intended for this Param
description - User description of Param (40 chars or less)
required - true is param is required

DataStoreFactorySpi.Param

public DataStoreFactorySpi.Param(java.lang.String key,
                                 java.lang.Class type,
                                 java.lang.String description,
                                 boolean required,
                                 java.lang.Object sample)
Provides support for text representations

Parameters:
key - Key used to file this Param in the Parameter Map for createDataStore
type - Class type intended for this Param
description - User description of Param (40 chars or less)
required - true is param is required
sample - Sample value as an example for user input
Method Detail

lookUp

public java.lang.Object lookUp(java.util.Map map)
                        throws java.io.IOException
Lookup Param in a user supplied map.

Type conversion will occur if required, this may result in an IOException. An IOException will be throw in the Param is required and the Map does not contain the Map.

The handle method is used to process the user's value.

Parameters:
map - Map of user input
Returns:
Parameter as specified in map
Throws:
IOException - if parse could not handle value

text

public java.lang.String text(java.lang.Object value)
Convert value to text representation for this Parameter

Parameters:
value - DOCUMENT ME!
Returns:
DOCUMENT ME!

handle

public java.lang.Object handle(java.lang.String text)
                        throws java.io.IOException
Handle text in a sensible manner.

Performs the most common way of handling text value:

Parameters:
text -
Returns:
Value as processed by text
Throws:
IOException - If text could not be parsed
DataSourceException - DOCUMENT ME!

parse

public java.lang.Object parse(java.lang.String text)
                       throws java.lang.Throwable
Provides support for text representations

Provides basic support for common types using reflection.

If needed you may extend this class to handle your own custome types.

Parameters:
text - Text representation of type should not be null or empty
Returns:
Object converted from text representation
Throws:
Throwable - DOCUMENT ME!
IOException - If text could not be parsed
DataSourceException - DOCUMENT ME!


Copyright © GeoTools. All Rights Reserved.