Validatinator.prepareParameters(Array validationParameters)

Preps the parameters so they can be used when making the validation calls.

@Added: 1/5/2014
505860
function(validationParameters) {
        var i = 0,
            j = 0;

        // We need to loop through each of the "extra parameters" and furthur split the `parameters` if need be.
        for (; i < validationParameters.length; i++) {
            // Check to see if we have third level "parameters" that will be transformed into an array for specific
            // validation methods.  i.e:  not_in:foo,bar,baz.
            if (validationParameters[i].contains(",")) {
                validationParameters[i] = validationParameters[i].split(",");

                // Since there was third level "parameters" we will go ahead and loop through each of the elements and
                // trim away any whitespace and convert falsey or truthy values to their boolean representations.
                for (; j < validationParameters[i].length; j++) {
                    validationParameters[i][j] = this.utils.convertStringToBoolean(validationParameters[i][j].trim());
                }
            } else {
                // Trim any whitespace and convert falsy or truthy values to their boolean representations
                validationParameters[i] = this.utils.convertStringToBoolean(validationParameters[i].trim());
            }
        }

        return validationParameters;
    }
1102885
@Override
    protected Validator createValidator() throws JspException
    {
        if (null == _minimum && null == _maximum)
        {
            throw new JspException("a minimum and / or a maximum have to be specified");
        }
        ELContext elContext = FacesContext.getCurrentInstance().getELContext();
        if (null != _minimum)
        {
            _min = getValue(_minimum.getValue(elContext));
        }
        if (null != _maximum)
        {
            _max = getValue(_maximum.getValue(elContext));
        }
        if (null != _minimum && null != _maximum)
        {
            if (!isMinLTMax())
            {
                throw new JspException("maximum limit must be greater than the minimum limit");
            }
        }
        return super.createValidator();
    }
1269585
function Validatinator(validationInformation, validationErrorMessages) {
    if (! (this instanceof Validatinator)) {
        throw new Error("Whoops!  Validatinator must be called with the new keyword!");
    }

    // Users may want to add validation information later on so we will allow them to create an instance of Validatinator without passing
    // any validation information.
    this.validationInformation = (validationInformation !== undefined) ? this.utils.convertFieldValidationsToArray(validationInformation) : {};
    this.errors = {};

    // Current form & field we are validating against.
    this.currentForm;
    this.currentField;

    // Give our validations prototype object the properties needed to access the parent and utils methods.
    this.validations.parent = this;
    this.messages.parent = this;
    this.validations.utils = this.utils;
    this.messages.utils = this.utils;

    // Overwrite and create new validationErrorMessages if the user provided any.
    if (validationErrorMessages !== undefined) {
        this.messages.overwriteAndAddNewMessages(validationErrorMessages);
    }
}
27932
public void prepare() {
        this.token_array = this.prepareTokenArray();
        SuffixData suffixData = SuffixArrays.createWithLCP(token_array, new SAIS(), comparator);
        this.suffix_array = suffixData.getSuffixArray();
        this.LCP_array = suffixData.getLCP();
        this.blocks = splitLCP_ArrayIntoIntervals();
        constructWitnessToBlockInstancesMap();
    }
46494
public void prepare(ResponseBuilder rb, ComponentFields mtasFields)
      throws IOException {
    Set<String> ids = MtasSolrResultUtil
        .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR);
    if (!ids.isEmpty()) {
      int tmpCounter = 0;
      String[] fields = new String[ids.size()];
      String[] keys = new String[ids.size()];
      String[] prefixes = new String[ids.size()];
      String[][] distanceKeys = new String[ids.size()][];
      String[][] distanceTypes = new String[ids.size()][];
      String[][] distanceBases = new String[ids.size()][];
      Map<String, String>[][] distanceParameters = new Map[ids.size()][];
      String[][] distanceMinimums = new String[ids.size()][];
      String[][] distanceMaximums = new String[ids.size()][];
      String[] regexps = new String[ids.size()];
      String[] fulls = new String[ids.size()];
      String[] sortTypes = new String[ids.size()];
      String[] sortDirections = new String[ids.size()];
      String[] types = new String[ids.size()];
      String[] startValues = new String[ids.size()];
      String[] numbers = new String[ids.size()];
      String[] numberShards = new String[ids.size()];
      String[][] functionExpressions = new String[ids.size()][];
      String[][] functionKeys = new String[ids.size()][];
      String[][] functionTypes = new String[ids.size()][];
      String[] boundaries = new String[ids.size()];
      String[] lists = new String[ids.size()];
      Boolean[] listRegexps = new Boolean[ids.size()];
      String[] ignoreRegexps = new String[ids.size()];
      String[] ignoreLists = new String[ids.size()];
      Boolean[] ignoreListRegexps = new Boolean[ids.size()];
      for (String id : ids) {
        fields[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_FIELD,
            null);
        keys[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_KEY,
            String.valueOf(tmpCounter)).trim();
        prefixes[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
            + "." + id + "." + NAME_MTAS_TERMVECTOR_PREFIX, null);
        Set<String> distanceIds = MtasSolrResultUtil
            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR
                + "." + id + "." + NAME_MTAS_TERMVECTOR_DISTANCE);
        distanceKeys[tmpCounter] = new String[distanceIds.size()];
        distanceTypes[tmpCounter] = new String[distanceIds.size()];
        distanceBases[tmpCounter] = new String[distanceIds.size()];
        distanceParameters[tmpCounter] = new Map[distanceIds.size()];
        distanceMinimums[tmpCounter] = new String[distanceIds.size()];
        distanceMaximums[tmpCounter] = new String[distanceIds.size()];
        int tmpSubDistanceCounter = 0;
        for (String distanceId : distanceIds) {
          distanceKeys[tmpCounter][tmpSubDistanceCounter] = rb.req.getParams()
              .get(
                  PARAM_MTAS_TERMVECTOR + "." + id + "."
                      + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                      + NAME_MTAS_TERMVECTOR_DISTANCE_KEY,
                  String.valueOf(tmpSubDistanceCounter))
              .trim();
          distanceTypes[tmpCounter][tmpSubDistanceCounter] = rb.req.getParams()
              .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_TYPE, null);
          distanceBases[tmpCounter][tmpSubDistanceCounter] = rb.req.getParams()
              .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_BASE, null);
          distanceParameters[tmpCounter][tmpSubDistanceCounter] = new HashMap<>();
          Set<String> parameters = MtasSolrResultUtil.getIdsFromParameters(
              rb.req.getParams(),
              PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_PARAMETER);
          for (String parameter : parameters) {
            distanceParameters[tmpCounter][tmpSubDistanceCounter].put(parameter,
                rb.req.getParams()
                    .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                        + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                        + NAME_MTAS_TERMVECTOR_DISTANCE_PARAMETER + "."
                        + parameter));
          }
          distanceMinimums[tmpCounter][tmpSubDistanceCounter] = rb.req
              .getParams()
              .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_MINIMUM, null);
          distanceMaximums[tmpCounter][tmpSubDistanceCounter] = rb.req
              .getParams()
              .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_MAXIMUM, null);
          tmpSubDistanceCounter++;
        }
        regexps[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR + "."
            + id + "." + NAME_MTAS_TERMVECTOR_REGEXP, null);
        fulls[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_FULL,
            null);
        sortTypes[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
            + "." + id + "." + NAME_MTAS_TERMVECTOR_SORT_TYPE, null);
        sortDirections[tmpCounter] = rb.req.getParams()
            .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                + NAME_MTAS_TERMVECTOR_SORT_DIRECTION, null);
        startValues[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_START,
            null);
        numbers[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR + "."
            + id + "." + NAME_MTAS_TERMVECTOR_NUMBER, null);
        numberShards[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
            + "." + id + "." + NAME_MTAS_TERMVECTOR_NUMBER_SHARDS, null);
        types[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_TYPE,
            null);
        Set<String> functionIds = MtasSolrResultUtil
            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR
                + "." + id + "." + NAME_MTAS_TERMVECTOR_FUNCTION);
        functionExpressions[tmpCounter] = new String[functionIds.size()];
        functionKeys[tmpCounter] = new String[functionIds.size()];
        functionTypes[tmpCounter] = new String[functionIds.size()];
        int tmpSubFunctionCounter = 0;
        for (String functionId : functionIds) {
          functionKeys[tmpCounter][tmpSubFunctionCounter] = rb.req.getParams()
              .get(
                  PARAM_MTAS_TERMVECTOR + "." + id + "."
                      + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionId + "."
                      + NAME_MTAS_TERMVECTOR_FUNCTION_KEY,
                  String.valueOf(tmpSubFunctionCounter))
              .trim();
          functionExpressions[tmpCounter][tmpSubFunctionCounter] = rb.req
              .getParams()
              .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionId + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION_EXPRESSION, null);
          functionTypes[tmpCounter][tmpSubFunctionCounter] = rb.req.getParams()
              .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionId + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION_TYPE, null);
          tmpSubFunctionCounter++;
        }
        boundaries[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
            + "." + id + "." + NAME_MTAS_TERMVECTOR_BOUNDARY, null);
        lists[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_LIST);
        listRegexps[tmpCounter] = rb.req.getParams()
            .getBool(PARAM_MTAS_TERMVECTOR + "." + id + "."
                + NAME_MTAS_TERMVECTOR_LIST_REGEXP, false);
        ignoreRegexps[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
            + "." + id + "." + NAME_MTAS_TERMVECTOR_IGNORE_REGEXP, null);
        ignoreLists[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
            + "." + id + "." + NAME_MTAS_TERMVECTOR_IGNORE_LIST, null);
        ignoreListRegexps[tmpCounter] = rb.req.getParams()
            .getBool(PARAM_MTAS_TERMVECTOR + "." + id + "."
                + NAME_MTAS_TERMVECTOR_IGNORE_LIST_REGEXP, false);
        tmpCounter++;
      }
      String uniqueKeyField = rb.req.getSchema().getUniqueKeyField().getName();
      mtasFields.doTermVector = true;
      rb.setNeedDocSet(true);
      // init and checks
      for (String field : fields) {
        if (field == null || field.isEmpty()) {
          throw new IOException("no (valid) field in mtas termvector");
        } else if (!mtasFields.list.containsKey(field)) {
          mtasFields.list.put(field, new ComponentField(uniqueKeyField));
        }
      }
      MtasSolrResultUtil.compareAndCheck(keys, fields, NAME_MTAS_TERMVECTOR_KEY,
          NAME_MTAS_TERMVECTOR_FIELD, true);
      MtasSolrResultUtil.compareAndCheck(prefixes, fields,
          NAME_MTAS_TERMVECTOR_PREFIX, NAME_MTAS_TERMVECTOR_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(regexps, fields,
          NAME_MTAS_TERMVECTOR_REGEXP, NAME_MTAS_TERMVECTOR_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(types, fields,
          NAME_MTAS_TERMVECTOR_TYPE, NAME_MTAS_TERMVECTOR_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(sortTypes, fields,
          NAME_MTAS_TERMVECTOR_SORT_TYPE, NAME_MTAS_TERMVECTOR_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(sortDirections, fields,
          NAME_MTAS_TERMVECTOR_SORT_DIRECTION, NAME_MTAS_TERMVECTOR_FIELD,
          false);
      MtasSolrResultUtil.compareAndCheck(numbers, fields,
          NAME_MTAS_TERMVECTOR_NUMBER, NAME_MTAS_TERMVECTOR_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(boundaries, fields,
          NAME_MTAS_TERMVECTOR_BOUNDARY, NAME_MTAS_TERMVECTOR_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(lists, fields,
          NAME_MTAS_TERMVECTOR_LIST, NAME_MTAS_TERMVECTOR_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(ignoreRegexps, fields,
          NAME_MTAS_TERMVECTOR_IGNORE_REGEXP, NAME_MTAS_TERMVECTOR_FIELD,
          false);
      MtasSolrResultUtil.compareAndCheck(ignoreLists, fields,
          NAME_MTAS_TERMVECTOR_IGNORE_LIST, NAME_MTAS_TERMVECTOR_FIELD, false);
      for (int i = 0; i < fields.length; i++) {
        if (!rb.req.getParams().getBool(ShardParams.IS_SHARD, false)) {
          numberShards[i] = null;
          boundaries[i] = null;
        }
        String field = fields[i];
        String prefix = (prefixes[i] == null) || (prefixes[i].isEmpty()) ? null
            : prefixes[i].trim();
        String key = (keys[i] == null) || (keys[i].isEmpty())
            ? String.valueOf(i) + ":" + field + ":" + prefix : keys[i].trim();
        String[] distanceKey = distanceKeys[i];
        String[] distanceType = distanceTypes[i];
        String[] distanceBase = distanceBases[i];
        Map<String, String>[] distanceParameter = distanceParameters[i];
        String[] distanceMinimum = distanceMinimums[i];
        String[] distanceMaximum = distanceMaximums[i];
        String regexp = (regexps[i] == null) || (regexps[i].isEmpty()) ? null
            : regexps[i].trim();
        Boolean full = (fulls[i] == null) || (!fulls[i].equals("true")) ? false
            : true;
        String startValue = (startValues[i] == null)
            || (startValues[i].isEmpty()) ? null : startValues[i].trim();
        int listNumber = (numbers[i] == null) || (numbers[i].isEmpty())
            ? DEFAULT_NUMBER : Integer.parseInt(numbers[i]);
        int numberFinal = (numberShards[i] == null)
            || (numberShards[i].isEmpty()) ? listNumber
                : Integer.parseInt(numberShards[i]);
        String type = (types[i] == null) || (types[i].isEmpty()) ? null
            : types[i].trim();
        String sortType = (sortTypes[i] == null) || (sortTypes[i].isEmpty())
            ? null : sortTypes[i].trim();
        String sortDirection = (sortDirections[i] == null)
            || (sortDirections[i].isEmpty()) ? null : sortDirections[i].trim();
        String[] functionKey = functionKeys[i];
        String[] functionExpression = functionExpressions[i];
        String[] functionType = functionTypes[i];
        String boundary = boundaries[i];
        String[] list = null;
        Boolean listRegexp = listRegexps[i];
        if (lists[i] != null) {
          ArrayList<String> tmpList = new ArrayList<>();
          String[] subList = lists[i].split("(?<!\\\\),");
          for (int j = 0; j < subList.length; j++) {
            tmpList.add(subList[j].replace("\\,", ",").replace("\\\\", "\\"));
          }
          list = tmpList.toArray(new String[tmpList.size()]);
        }
        String ignoreRegexp = ignoreRegexps[i];
        String[] ignoreList = null;
        Boolean ignoreListRegexp = ignoreListRegexps[i];
        if (ignoreLists[i] != null) {
          ArrayList<String> tmpList = new ArrayList<>();
          String[] subList = ignoreLists[i].split("(?<!\\\\),");
          for (int j = 0; j < subList.length; j++) {
            tmpList.add(subList[j].replace("\\,", ",").replace("\\\\", "\\"));
          }
          ignoreList = tmpList.toArray(new String[tmpList.size()]);
        }

        if (prefix == null || prefix.isEmpty()) {
          throw new IOException("no (valid) prefix in mtas termvector");
        } else {
          try {
            mtasFields.list.get(field).termVectorList.add(
                new ComponentTermVector(key, prefix, distanceKey, distanceType,
                    distanceBase, distanceParameter, distanceMinimum,
                    distanceMaximum, regexp, full, type, sortType,
                    sortDirection, startValue, numberFinal, functionKey,
                    functionExpression, functionType, boundary, list,
                    listRegexp, ignoreRegexp, ignoreList, ignoreListRegexp));
          } catch (ParseException e) {
            throw new IOException(e);
          }
        }
      }

    }
  }
1206216
@Override
    protected void checkParameters() {
        super.checkParameters();

        if (outputFile == null) {
            throw new BuildException("output attribute is required", getLocation());
        }

        if (inputFile == null) {
            throw new BuildException("inputFile element is required");
        }

        checkBoolean(notAProblem, "notAProblem");
        checkBoolean(withSource, "withSource");
        checkBoolean(applySuppression, "applySuppression");
        checkBoolean(active, "active");
        checkBoolean(introducedByChange, "introducedByChange");
        checkBoolean(removedByChange, "removedByChange");
        checkBoolean(newCode, "newCode");
        checkBoolean(removedCode, "removedCode");
        checkBoolean(withMessages, "withMessages");
    }
516842
protected function prepareParameters(ReflectionMethod $constructor, $additionalParameters)
    {
        $parameters = array();
        foreach ($constructor->getParameters() as $parameter) {
            $parameterValue = null;
        
            if (isset($additionalParameters[$parameter->name])) {
                $parameterValue = $additionalParameters[$parameter->name];
            } else if ($parameter->getClass() !== null) {
                $parameterValue = $this->getInstance($parameter->getClass());
            }
        
            if ($parameterValue === null) {
                throw new Exception('Cannot find correct value for parameter "' . $parameter->name . '" in class "' . $constructor->class . '".');
            }
        
            $parameters[] = $parameterValue;
        }
        
        return $parameters;
    }
189306
public function validate() {
		parent::validate();

		if ($this->getName() === null) {
			throw new ValidationException("'name' can't be null", 'name', $this);
		}
		if ($this->getType() === null) {
			throw new ValidationException("'type' can't be null", 'type', $this);
		}
	}
800604
protected function prepareArguments($reflection_parameter, $arguments) {
		$array_type = $this->getArrayType($arguments);
		$prepared = array();

		if ($array_type == self::ARRAY_TYPE_LIST) {
			$prepared = $arguments;
		} elseif ($array_type == self::ARRAY_TYPE_DICT) {
			foreach ($reflection_parameter as $parameter) {
				$name = $parameter->getName();

				if (isset($arguments[$name])) {
					$value = $arguments[$name];
				} else if ($parameter->isDefaultValueAvailable()) {
					$value = $parameter->getDefaultValue();
				} else {
					throw new InvalidParameterException("Missing parameter '$name' on position {$parameter->getPosition()}");
				}

				$prepared[] = $value;
			}
		} else {
			throw new InvalidParameterException('Unable to handle mixed arrays');
		}

		return $prepared;
	}
694960
public function validate(&$params)
    {
        if (!is_array($params)) {
            throw new InvalidArgumentException('Please use array params when call validate.');
        }
        $rules = $this->validators;

        if (count($params) < count($rules)) {
            if (!isset($this->defaultValues) || empty($this->defaultValues)) {
                throw new InvalidArgumentException('The params are less than validators.');
            }
            $defaultValues = $this->defaultValues;

            foreach ($defaultValues as $key => $value) {
                if (!isset($params[$key])) {
                    $params[$key] = $value;
                }

            }
        } elseif (count($params) > count($rules)) {
            throw new InvalidArgumentException('The params are more than validators.');
        }
        foreach ($rules as $key => $rule) {
            if (isset($params[$key])) {
                if (is_array($rule)) {
                    $isError = true;

                    foreach ($rule as $subRule) {
                        if (call_user_func([$subRule, 'validate'], $params[$key]) === true) {
                            $isError = false;
                            break;
                        }
                    }
                    if ($isError) {
                        throw new RuntimeException('Wrong type of ' . $this->method . ' method argument ' . $key . '.');
                    }
                } else {
                    if (call_user_func([$rule, 'validate'], $params[$key]) === false) {
                        throw new RuntimeException('Wrong type of ' . $this->method . ' method argument ' . $key . '.');
                    }
                }
            } else {
                throw new RuntimeException($this->method . ' method argument ' . $key . ' doesn\'t have default value.');
            }
        }
        return true;
    }
1014511
private function validate()
    {
        $required = '';

        $validations = [
            'FirstnameOrLastname',
            'PhoneCellphoneOrEmail',
            'ContactTypeId',
            'BusinessTypeId',
            'SuboriginId',
        ];

        for ($i = 0; $i < count($validations) && empty($required); $i++) {
            $required = $this->{"validate" . $validations[$i]}();
        }

        if (!empty($required)) {
            throw new InvalidArgumentException(
                sprintf('Missing required value: %s.', $required)
            );
        }
    }
854191
@Override
    public void validate() {
        String target = getTargetName();
        //validate the parameters
        if (delay() < 0) {
            throw new FaultToleranceDefinitionException(Tr.formatMessage(tc, "circuitBreaker.parameter.delay.invalid.value.CWMFT5012E", "delay", delay(), target));
        }
        if ((failureRatio() < 0) || (failureRatio() > 1)) {
            throw new FaultToleranceDefinitionException(Tr.formatMessage(tc, "circuitBreaker.parameter.failureRatio.invalid.value.CWMFT5013E", "failureRatio",
                                                                         failureRatio(),
                                                                         target));
        }
        if (requestVolumeThreshold() < 1) {
            throw new FaultToleranceDefinitionException(Tr.formatMessage(tc, "circuitBreaker.parameter.requestVolumeThreshold.invalid.value.CWMFT5014E", "requestVolumeThreshold",
                                                                         requestVolumeThreshold(), target));
        }
        if (successThreshold() < 1) {
            throw new FaultToleranceDefinitionException(Tr.formatMessage(tc, "circuitBreaker.parameter.successThreshold.invalid.value.CWMFT5015E", "successThreshold",
                                                                         successThreshold(), target));
        }
        if (failOn().length == 0) {
            throw new FaultToleranceDefinitionException(Tr.formatMessage(tc, "circuitBreaker.parameter.failOn.invalid.value.CWMFT5018E", "failOn", target));
        }

    }
338542
private void validateParameters(String filePath, String password, int validity, String subjectDN, int keySize, String sigAlg) {
        if (!validateFilePath(filePath)) {
            throw new IllegalArgumentException("filePath must be a valid filePath within the file system.");
        }
        if (password == null || password.length() < MINIMUM_PASSWORD_LENGTH) {
            throw new IllegalArgumentException("The password must be at least " +
                                               MINIMUM_PASSWORD_LENGTH +
                                               " characters in length.");
        }
        if (validity < MINIMUM_VALIDITY) {
            throw new IllegalArgumentException("The validity period must be at least " +
                                               MINIMUM_VALIDITY + " days.");
        }

        List<String> validSigAlg = VALID_SIG_ALG;
        if (!validSigAlg.contains(sigAlg)) {
            throw new IllegalArgumentException("The signagure algorithm values include " + VALID_SIG_ALG);
        }

        String type = getKeyFromSigAlg(sigAlg);
        if (type.equals(KEYALG_RSA_TYPE)) {
            List<Integer> validKeySizes = VALID_RSA_KEYSIZE;
            if (!validKeySizes.contains(keySize)) {
                throw new IllegalArgumentException("The key sizes for an RSA key include " + VALID_RSA_KEYSIZE);
            }
        } else {
            List<Integer> validKeySizes = VALID_EC_KEYSIZE;
            if (!validKeySizes.contains(keySize)) {
                throw new IllegalArgumentException("The key sizes for an EC key include " + VALID_EC_KEYSIZE);
            }
        }

        validateSubjectDN(subjectDN);
    }
1261250
@Override
	protected void validateParameters() {
		super.validateParameters();
		// override some arguments
		parameters.put(OPT_NOPREVIEW, "");
		parameters.put(OPT_RAW, "-");// must be this, then image will be in console!
		parameters.put(OPT_RAW_FORMAT, "rgb");// only support rgb
		parameters.put(OPT_CAMSELECT, Integer.toString(this.camSelect));
		parameters.put(OPT_OUTPUT, "/dev/null");
	}
231665
protected void validateParameters(Map<String, Value> callParameters) {
        for (String name : callParameters.keySet()) {
            if (!parameters.containsKey(name)) throw new IllegalParametersException("Parameter not supported: " + name);
        }
        for (Map.Entry<String, MethodParameter> entry : parameters.entrySet()) {
            if (entry.getValue().isOptional()) continue;
            if (!callParameters.containsKey(entry.getKey())) {
                throw new IllegalParametersException("Parameter not supplied: " + entry.getKey());
            }
        }
    }
1215345
private void initializeValidateButton() {
        Button button = (Button) findViewById(R.id.validate_button);
        button.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(final View v) {
                usernameEditText.validate();
                passwordEditText.validate();
                passwordRepetitionEditText.validate();
                genderSpinner.validate();
                firstNameEditText.validate();
                lastNameEditText.validate();
                additionalInformationEditText.validate();
            }

        });
    }
1089612
@Override
    protected void prepare() throws JspTagException {
        if (items instanceof ValueExpression) {
            deferredExpression = (ValueExpression) items;
            itemsValueIteratedExpression = new IteratedExpression(deferredExpression, getDelims());
            currentIndex = 0;

            Object originalValue = deferredExpression.getValue(pageContext.getELContext());
            if (originalValue instanceof String) {
                st = new StringTokenizer((String) originalValue, delims);
            } else {
                throw new JspTagException();
            }
        } else {
            st = new StringTokenizer((String) items, delims);
        }
    }