Class Parameter<T>
- All Implemented Interfaces:
Parameter<T>
- Direct Known Subclasses:
DataAccessFactory.Param
- Author:
- gdavis
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
"crs": CoordinateReferenceSystem used to restrict a Geometry literalstatic final String
Set parameter to deprecated - true, false ;can be used to conditional show the parameter based on deprecated valuefinal InternationalString
Human readable description of this parameter.static final String
"element": Class to use as the Element type for List. static final String
File extension expected - "shp", "jpg", etc...static final String
"featureType" FeatureType to validate a Feature value againststatic final String
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 likestatic final String
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, etcfinal String
This is the key (ie machine readable text) used to represent this parameter in a java.util.Map.static final String
"length" Integer used to limit the length of strings or literal geometries.static final String
Level or Category of the parameter - "user", "advanced", "program"static final String
"min" and "max" may be useful for restrictions for things like int sizes, etc.final int
Refinement of type; such as the FeatureType of a FeatureCollection, or component type of a List.static final String
"min" and "max" may be useful for restrictions for things like int sizes, etc.final int
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 )static final String
As an alternative to "min" and "max" a speciifc Listof options can be provided for a user to choose between. final boolean
Can the value be missing?final T
A sample value; often used as a default when prompting the end-user to fill in the details before executing a process.final InternationalString
Human readable title/name of this parameter.Class binding for this parameter. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a parameter from key and typeConstructs a parameter from key, type, and min/max occurs.Mandatory parameter - quickly constructed with out a properly internationalized title and description.Mandatory parameter - quickly constructed with out a properly internationalized title and description.Parameter
(String key, Class<T> type, InternationalString title, InternationalString description) Mandatory parameterParameter
(String key, Class<T> type, InternationalString title, InternationalString description, boolean required, int min, int max, T sample, Map<String, Object> metadata) Addition of optional parametersParameter
(String key, Class<T> type, InternationalString title, InternationalString description, Map<String, Object> metadata) Mandatory parameter with metadata. -
Method Summary
Modifier and TypeMethodDescriptionboolean
A default value for the parameter.Description of the parameter.getLevel()
Easy access to check theLEVEL
metadataint
The maximum number of occurrences of the parameter.int
The minimum number of occurrences of the parameter.getName()
Name of the parameter.getTitle()
Title of the parameter.getType()
Type/class of the parameter.int
hashCode()
Easy access to check theDEPRECATED
metadataboolean
Provides for easy access to theIS_PASSWORD
metadataFlag indicating if the parameter is required or not.toString()
-
Field Details
-
key
This is the key (ie machine readable text) used to represent this parameter in a java.util.Map. -
title
Human readable title/name of this parameter. -
description
Human readable description of this parameter. -
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 requiredCan the value be missing? Or is null allowed... Return true if a value is required to be both present and non null -
minOccurs
public final int minOccursWhat 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
A sample value; often used as a default when prompting the end-user to fill in the details before executing a process. -
FEATURE_TYPE
"featureType" FeatureType to validate a Feature value against- See Also:
-
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:
-
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- See Also:
-
LENGTH
"length" Integer used to limit the length of strings or literal geometries.- See Also:
-
CRS
"crs": CoordinateReferenceSystem used to restrict a Geometry literal- See Also:
-
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:
-
MIN
"min" and "max" may be useful for restrictions for things like int sizes, etc.- See Also:
-
MAX
"min" and "max" may be useful for restrictions for things like int sizes, etc.- See Also:
-
OPTIONS
As an alternative to "min" and "max" a speciifc Listof options can be provided for a user to choose between. The description should explain what the options mean. Example: a compliance level of (0-low,1-medium,2-high)
Although a List
is used here (so you can specifiy order) it is assumed you will not confuse your users by placing duplicates in the list. - See Also:
-
EXT
File extension expected - "shp", "jpg", etc...- See Also:
-
LEVEL
Level or Category of the parameter - "user", "advanced", "program"- user - should be shown to all users and is used every time.
example: user name and password - advanced - advanced or expert parameter used in special cases
example: choice between get and post requests for WFS - program - intended for programs often tweaking settings for performance
example: JDBC datasource for which it is hard for a user to type in
- See Also:
- user - should be shown to all users and is used every time.
-
DEPRECATED
Set parameter to deprecated - true, false ;can be used to conditional show the parameter based on deprecated value- See Also:
-
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:
-
-
Constructor Details
-
Parameter
Mandatory parameter - quickly constructed with out a properly internationalized title and description.- Parameters:
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 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.Maptype
- Java class for the expected valuetitle
- Human readable title used for use in a user interfacedescription
- 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.Maptype
- Java class for the expected valuetitle
- Human readable title used for use in a user interfacedescription
- 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.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)- See Also:
-
Parameter
public Parameter(String key, Class<T> type, InternationalString title, InternationalString description, boolean required, int min, int max, T sample, Map<String, Object> metadata) Addition of optional parameters- Parameters:
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)- See Also:
-
Parameter
Constructs a parameter from key and type- Parameters:
key
- machine readable key for use in a java.util.Maptype
- Java class for the expected value
-
Parameter
Constructs a parameter from key, type, and min/max occurs.- Parameters:
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 unbound
-
-
Method Details
-
getName
Description copied from interface:Parameter
Name of the parameter. -
getTitle
Description copied from interface:Parameter
Title of the parameter. -
getDescription
Description copied from interface:Parameter
Description of the parameter.- Specified by:
getDescription
in interfaceParameter<T>
-
getType
Description copied from interface:Parameter
Type/class of the parameter. -
isRequired
Description copied from interface:Parameter
Flag indicating if the parameter is required or not.- Specified by:
isRequired
in interfaceParameter<T>
-
getMinOccurs
public int getMinOccurs()Description copied from interface:Parameter
The minimum number of occurrences of the parameter.- Specified by:
getMinOccurs
in interfaceParameter<T>
- Returns:
- minimum number of occurrences, or -1 if no minimum needed
-
getMaxOccurs
public int getMaxOccurs()Description copied from interface:Parameter
The maximum number of occurrences of the parameter.- Specified by:
getMaxOccurs
in interfaceParameter<T>
- Returns:
- maximum number of occurences, or -1 for unbound
-
getDefaultValue
Description copied from interface:Parameter
A default value for the parameter.- Specified by:
getDefaultValue
in interfaceParameter<T>
-
isPassword
public boolean isPassword()Provides for easy access to theIS_PASSWORD
metadata- Returns:
- true if
metadata.get(IS_PASSWORD) == Boolean.TRUE
-
isDeprecated
Easy access to check theDEPRECATED
metadata- Returns:
- provided deprecated or false by default
-
getLevel
Easy access to check theLEVEL
metadata- Returns:
- provided level or "user" by default
-
toString
-
hashCode
public int hashCode() -
equals
-