com.supermap.services.wms.request

Class ParameterValidator

  • java.lang.Object
    • com.supermap.services.wms.request.ParameterValidator


  • 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.

    • Field Summary

      Fields 
      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 Summary

      Constructors 
      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.
    • Method Summary

      Methods 
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REGULAR_START

        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 “^”.

      • REGULAR_END

        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 “$”.

    • Constructor Detail

      • ParameterValidator

        public ParameterValidator()
        

        Default constructor.

      • ParameterValidator

        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.

        Parameters:
        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.
    • Method Detail

      • validate

        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.

        Parameters:
        paramMap - the parameter is a java.util.Map object, the key is the parameter name of the request, the value is the parameter value.
        Returns:
        verification result.