org.geotools.data
Class Parameter<T>

Object
  extended by Parameter<T>
Direct Known Subclasses:
DataAccessFactory.Param

public class Parameter<T>
extends Object

A Parameter defines information about a valid process parameter.

Author:
gdavis
Module:
modules/library/api (gt-api.jar)

Field Summary
static String CRS
          "crs": CoordinateReferenceSystem used to restrict a Geometry literal
 InternationalString description
          Human readable description of this parameter.
static String ELEMENT
          "element": Class to use as the Element type for List.
static String EXT
          File extension expected - "shp", "jpg", etc...
static String FEATURE_TYPE
          "featureType" FeatureType to validate a Feature value against
static String IS_PASSWORD
          Boolean indicating whether the parameter shall be used as a password field, provides a hint for UI's to mask text fields, configuration systems to encrypt content, etc
 String key
          This is the key (ie machine readable text) used to represent this parameter in a java.util.Map.
static String LENGTH
          "length" Integer used to limit the length of strings or literal geometries.
static String LEVEL
          Level or Category of the parameter - "user", "advanced", "program" user - should be shown to all users and is used every time.
static String MAX
          "min" and "max" may be useful for restrictions for things like int sizes, etc.
 int maxOccurs
           
 Map<String,Object> metadata
          Refinement of type; such as the FeatureType of a FeatureCollection, or component type of a List.
static String MIN
          "min" and "max" may be useful for restrictions for things like int sizes, etc.
 int minOccurs
          What is the min and max number of this paramter there can be ( a value of -1 for min means 0 or more, a value of -1 for max means any number greater than or equal to the min value ) eg: a geometry union process can have any number of geom parameters, so by setting the max to -1 and the min to 2 we accomplish that.
 boolean required
          Can the value be missing?
 Object sample
          A sample value; often used as a default when prompting the end-user to fill in the details before executing a process.
 InternationalString title
          Human readable title/name of this parameter.
 Class<T> type
          Class binding for this parameter.
 
Constructor Summary
Parameter(String key, Class<T> type, InternationalString title, InternationalString description)
          Mandatory parameter
Parameter(String key, Class<T> type, InternationalString title, InternationalString description, boolean required, int min, int max, Object sample, Map<String,Object> metadata)
          Addition of optional parameters
Parameter(String key, Class<T> type, InternationalString title, InternationalString description, Map<String,Object> metadata)
          Mandatory parameter with metadata.
Parameter(String key, Class<T> type, String title, String description)
          Mandatory parameter - quickly constructed with out a properly internationalized title and description.
Parameter(String key, Class<T> type, String title, String description, Map<String,Object> metadata)
          Mandatory parameter - quickly constructed with out a properly internationalized title and description.
 
Method Summary
 String getLevel()
          Easy access to check the LEVEL metadata
 boolean isPassword()
          Provides for easy access to the IS_PASSWORD metadata
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

public final String key
This is the key (ie machine readable text) used to represent this parameter in a java.util.Map.


title

public final InternationalString title
Human readable title/name of this parameter.


description

public final InternationalString description
Human readable description of this parameter.


type

public final Class<T> type
Class binding for this parameter.

When a value is supplied for this key it should be of the provided type.


required

public final boolean required
Can the value be missing? Or is null allowed...


minOccurs

public final int minOccurs
What is the min and max number of this paramter there can be ( a value of -1 for min means 0 or more, a value of -1 for max means any number greater than or equal to the min value ) eg: a geometry union process can have any number of geom parameters, so by setting the max to -1 and the min to 2 we accomplish that.


maxOccurs

public final int maxOccurs

sample

public final Object sample
A sample value; often used as a default when prompting the end-user to fill in the details before executing a process.


FEATURE_TYPE

public static final String FEATURE_TYPE
"featureType" FeatureType to validate a Feature value against

See Also:
Constant Field Values

IS_PASSWORD

public static final String IS_PASSWORD
Boolean indicating whether the parameter shall be used as a password field, provides a hint for UI's to mask text fields, configuration systems to encrypt content, etc

See Also:
Constant Field Values

LENGTH

public static final String LENGTH
"length" Integer used to limit the length of strings or literal geometries.

See Also:
Constant Field Values

CRS

public static final String CRS
"crs": CoordinateReferenceSystem used to restrict a Geometry literal

See Also:
Constant Field Values

ELEMENT

public static final String ELEMENT
"element": Class to use as the Element type for List. Please restrict your use of this facility to simple types; for most higher order data structures multiplicity is already accounted for - example MultiGeometry.

See Also:
Constant Field Values

MIN

public static final String MIN
"min" and "max" may be useful for restrictions for things like int sizes, etc.

See Also:
Constant Field Values

MAX

public static final String MAX
"min" and "max" may be useful for restrictions for things like int sizes, etc.

See Also:
Constant Field Values

EXT

public static final String EXT
File extension expected - "shp", "jpg", etc...

See Also:
Constant Field Values

LEVEL

public static final String LEVEL
Level or Category of the parameter - "user", "advanced", "program"

See Also:
Constant Field Values

metadata

public final Map<String,Object> metadata
Refinement of type; such as the FeatureType of a FeatureCollection, or component type of a List.

This information is supplied (along with type) to allow a process implementor communicate additional restrictions on the allowed value beyond the strict type.

The following keys are understood at this time: LENGTH, FEATURE_TYPE, CRS, ELEMENT .. additional keys will be documented as static final fields over time.

Any restrictions mentioned here should be mentioned as part of your parameter description. This metadata is only used to help restrict what the user enters; not all client application will understand and respect these keys - please communicate with your end-user.

See Also:
CRS, ELEMENT, FEATURE_TYPE, IS_PASSWORD, LENGTH, MAX, MIN
Constructor Detail

Parameter

public Parameter(String key,
                 Class<T> type,
                 String title,
                 String description)
Mandatory parameter - quickly constructed with out a properly internationalized title and description.

Parameters:
key - machine readable key for use in a java.util.Map
type - Java class for the expected value
title - Human readable title used for use in a user interface
description - Human readable description

Parameter

public Parameter(String key,
                 Class<T> type,
                 String title,
                 String description,
                 Map<String,Object> metadata)
Mandatory parameter - quickly constructed with out a properly internationalized title and description.

Parameters:
key - machine readable key for use in a java.util.Map
type - Java class for the expected value
title - Human readable title used for use in a user interface
description - Human readable description

Parameter

public Parameter(String key,
                 Class<T> type,
                 InternationalString title,
                 InternationalString description)
Mandatory parameter

Parameters:
key - machine readable key for use in a java.util.Map
type - Java class for the expected value
title - Human readable title used for use in a user interface
description - Human readable description

Parameter

public Parameter(String key,
                 Class<T> type,
                 InternationalString title,
                 InternationalString description,
                 Map<String,Object> metadata)
Mandatory parameter with metadata.

Parameters:
key - machine readable key for use in a java.util.Map
type - Java class for the expected value
title - Human readable title used for use in a user interface
description - Human readable description
metadata - Hints to the user interface (read the javadocs for each metadata key)
See Also:
CRS, ELEMENT, FEATURE_TYPE, IS_PASSWORD, LENGTH, MAX, MIN

Parameter

public Parameter(String key,
                 Class<T> type,
                 InternationalString title,
                 InternationalString description,
                 boolean required,
                 int min,
                 int max,
                 Object sample,
                 Map<String,Object> metadata)
Addition of optional parameters

Parameters:
key - machine readable key for use in a java.util.Map
type - Java class for the expected value
title - Human readable title used for use in a user interface
description - Human readable description
required - true if the value is required
min - Minimum value; or null if not needed
max - Maximum value; or null if not needed
sample - Sample value; may be used as a default in a user interface
metadata - Hints to the user interface (read the javadocs for each metadata key)
See Also:
CRS, ELEMENT, FEATURE_TYPE, IS_PASSWORD, LENGTH, MAX, MIN
Method Detail

isPassword

public boolean isPassword()
Provides for easy access to the IS_PASSWORD metadata

Returns:
true if metadata.get(IS_PASSWORD) == Boolean.TRUE

getLevel

public String getLevel()
Easy access to check the LEVEL metadata

Returns:
provided level or "user" by default


Copyright © 1996-2010 Geotools. All Rights Reserved.