public class ParameterValidator
extends java.lang.Object
Parameter verifier based on regular expression.
The required regular expressions are provided by initialization, and the correctness of the parameters is verified by regular expressions.
Modifier and Type | Field and Description |
---|---|
static char |
REGULAR_END
Meta char of the regular expression that matches the end position of the input string.
|
static char |
REGULAR_START
Meta char of the regular expression that matches the starting position of the input string.
|
Constructor and Description |
---|
ParameterValidator()
Default constructor.
|
ParameterValidator(java.util.Map<java.lang.String,java.util.regex.Pattern> required, java.util.Map<java.lang.String,OptionalParameter> optional, java.util.Map<java.lang.String,java.util.regex.Pattern> define)
Create ParameterValidator objects based on given parameters and regular expressions.
|
Modifier and Type | Method and Description |
---|---|
ValidateResult |
validate(java.util.Map<java.lang.String,java.lang.String> paramMap)
Verify the parameter in keyword-value format of the WMS request.
|
public static final char REGULAR_START
Meta char of the regular expression that matches the starting position of the input string.
The default value is “^”.
public static final char REGULAR_END
Meta char of the regular expression that matches the end position of the input string.
The default value is “$”.
public ParameterValidator()
Default constructor.
public ParameterValidator(java.util.Map<java.lang.String,java.util.regex.Pattern> required, java.util.Map<java.lang.String,OptionalParameter> optional, java.util.Map<java.lang.String,java.util.regex.Pattern> define)
Create ParameterValidator objects based on given parameters and regular expressions.
required
- java.util.Map object, which indicates the name and regular expression of the necessary parameter where the key is the parameter name, and the value is the relevant regular expression.optional
- java.util.Map object, which indicates the name and description of optional parameter, where the key is the parameter name, and the value is the description object (OptionalParameter
).define
- java.util.Map object, which indicates the name and regular expression of the operation defined parameter where the key is the parameter name, and the value is the relevant regular expression.public final ValidateResult validate(java.util.Map<java.lang.String,java.lang.String> paramMap)
Verify the parameter in keyword-value format of the WMS request.
paramMap
- the parameter is a java.util.Map object, the key is the parameter name of the request, the value is the parameter value.