public class Parameter<T> extends Object implements Parameter<T>
Modifier and Type | Field and Description |
---|---|
static String |
CRS
"crs": CoordinateReferenceSystem used to restrict a Geometry literal
|
static String |
DEPRECATED
Set parameter to deprecated - true, false ;can be used to conditional show the parameter
based on deprecated value
|
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_LARGE_TEXT
Boolean indicating whether the parameter is meant to be a long text, provides a hint for UI's
use long text fields, textareas and the like
|
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.
|
static String |
OPTIONS
As an alternative to "min" and "max" a speciifc List
|
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 and Description |
---|
Parameter(String key,
Class<T> type)
Constructs a parameter from key and type
|
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,
int min,
int max)
Constructs a parameter from key, type, and min/max occurs.
|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
T |
getDefaultValue()
A default value for the parameter.
|
InternationalString |
getDescription()
Description of the parameter.
|
String |
getLevel()
Easy access to check the
LEVEL metadata |
int |
getMaxOccurs()
The maximum number of occurrences of the parameter.
|
int |
getMinOccurs()
The minimum number of occurrences of the parameter.
|
String |
getName()
Name of the parameter.
|
InternationalString |
getTitle()
Title of the parameter.
|
Class<T> |
getType()
Type/class of the parameter.
|
int |
hashCode() |
Boolean |
isDeprecated()
Easy access to check the
DEPRECATED metadata |
boolean |
isPassword()
Provides for easy access to the
IS_PASSWORD metadata |
Boolean |
isRequired()
Flag indicating if the parameter is required or not.
|
String |
toString() |
public final String key
public final InternationalString title
public final InternationalString description
public final Class<T> type
When a value is supplied for this key it should be of the provided type.
public final boolean required
public final int minOccurs
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.
public final int maxOccurs
public final Object sample
public static final String FEATURE_TYPE
public static final String IS_PASSWORD
public static final String IS_LARGE_TEXT
public static final String LENGTH
public static final String CRS
public static final String ELEMENT
public static final String MIN
public static final String MAX
public static final String OPTIONS
Example: a compliance level of (0-low,1-medium,2-high)
Although a List
public static final String EXT
public static final String LEVEL
public static final String DEPRECATED
public final Map<String,Object> metadata
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.
CRS
,
ELEMENT
,
FEATURE_TYPE
,
IS_PASSWORD
,
LENGTH
,
MAX
,
MIN
public Parameter(String key, Class<T> type, String title, String description)
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected valuetitle
- Human readable title used for use in a user interfacedescription
- Human readable descriptionpublic Parameter(String key, Class<T> type, String title, String description, Map<String,Object> metadata)
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected valuetitle
- Human readable title used for use in a user interfacedescription
- Human readable descriptionpublic Parameter(String key, Class<T> type, InternationalString title, InternationalString description)
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected valuetitle
- Human readable title used for use in a user interfacedescription
- Human readable descriptionpublic Parameter(String key, Class<T> type, InternationalString title, InternationalString description, Map<String,Object> metadata)
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected valuetitle
- Human readable title used for use in a user interfacedescription
- Human readable descriptionmetadata
- Hints to the user interface (read the javadocs for each metadata key)CRS
,
ELEMENT
,
FEATURE_TYPE
,
IS_PASSWORD
,
LENGTH
,
MAX
,
MIN
public Parameter(String key, Class<T> type, InternationalString title, InternationalString description, boolean required, int min, int max, Object sample, Map<String,Object> metadata)
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected valuetitle
- Human readable title used for use in a user interfacedescription
- Human readable descriptionrequired
- true if the value is requiredmin
- Minimum value; or -1 if not neededmax
- Maximum value; or -1 for unboundsample
- Sample value; may be used as a default in a user interfacemetadata
- Hints to the user interface (read the javadocs for each metadata key)CRS
,
ELEMENT
,
FEATURE_TYPE
,
IS_PASSWORD
,
LENGTH
,
MAX
,
MIN
public Parameter(String key, Class<T> type)
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected valuepublic Parameter(String key, Class<T> type, int min, int max)
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected valuemin
- Minimum value of occurrences, -1 if not neededmax
- Maximum value of occurrences, -1 for unboundpublic InternationalString getTitle()
Parameter
public InternationalString getDescription()
Parameter
getDescription
in interface Parameter<T>
public Class<T> getType()
Parameter
public Boolean isRequired()
Parameter
isRequired
in interface Parameter<T>
public int getMinOccurs()
Parameter
getMinOccurs
in interface Parameter<T>
public int getMaxOccurs()
Parameter
getMaxOccurs
in interface Parameter<T>
public T getDefaultValue()
Parameter
getDefaultValue
in interface Parameter<T>
public boolean isPassword()
IS_PASSWORD
metadatametadata.get(IS_PASSWORD) == Boolean.TRUE
public Boolean isDeprecated()
DEPRECATED
metadatapublic String getLevel()
LEVEL
metadataCopyright © 1996–2019 Geotools. All rights reserved.