Class V2ParamValidator

java.lang.Object
org.codelibs.fess.api.v2.handlers.V2ParamValidator

public final class V2ParamValidator extends Object
Stateless helpers that enforce length/item-count bounds on v2 request parameters, throwing InvalidRequestParameterException on violation.
  • Method Details

    • checkMaxLength

      public static String checkMaxLength(String value, int max, String name)
      Checks that a string parameter does not exceed the given maximum length.
      Parameters:
      value - the parameter value (may be null)
      max - the maximum allowed length (inclusive)
      name - the parameter name used in the exception message
      Returns:
      the original value, or null if the input is null
      Throws:
      InvalidRequestParameterException - if value.length() > max
    • checkArray

      public static String[] checkArray(String[] values, int maxItems, int maxLen, String name)
      Checks that a string array parameter does not exceed the given item count or per-element length.
      Parameters:
      values - the parameter values (may be null)
      maxItems - the maximum allowed number of values (inclusive)
      maxLen - the maximum allowed length of each individual value (inclusive)
      name - the parameter name used in the exception message
      Returns:
      the original array, or null if the input is null
      Throws:
      InvalidRequestParameterException - if the array size or any element length is exceeded