Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.opensymphony.xwork2.validator.validators;
import com.opensymphony.xwork2.validator.ValidationException;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Arrays;
import java.util.Collection;
/**
*
* Field Validator that checks if the double specified is within a certain range.
*
*
*
*
*
*
fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required
*
minInclusive - the minimum inclusive value in FloatValue format specified by Java language (if none is specified, it will not be checked)
*
maxInclusive - the maximum inclusive value in FloatValue format specified by Java language (if none is specified, it will not be checked)
*
minExclusive - the minimum exclusive value in FloatValue format specified by Java language (if none is specified, it will not be checked)
*
maxExclusive - the maximum exclusive value in FloatValue format specified by Java language (if none is specified, it will not be checked)
*
minInclusiveExpression - the minimum inclusive value specified as a OGNL expression (if none is specified, it will not be checked)
*
maxInclusiveExpression - the maximum inclusive value specified as a OGNL expression (if none is specified, it will not be checked)
*
minExclusiveExpression - the minimum exclusive value specified as a OGNL expression (if none is specified, it will not be checked)
*
maxExclusiveExpression - the maximum exclusive value specified as a OGNL expression (if none is specified, it will not be checked)
*
*
* You can specify either minInclusive, maxInclusive, minExclusive and maxExclusive or minInclusiveExpression, maxInclusiveExpression,
* minExclusiveExpression and maxExclusiveExpression as a OGNL expression, see example below. You can always try to mix params
* but be aware that such behaviour was not tested.
*
*
*
*
* Do not use ${minInclusiveExpression}, ${maxInclusiveExpression}, ${minExclusiveExpressionExpression} and ${maxExclusive}
* as an expression as this will turn into infinitive loop!
*
*
*
*
*
* <validators>
* <!-- Plain Validator Syntax -->
* <validator type="double">
* <param name="fieldName">percentage</param>
* <param name="minInclusive">20.1</param>
* <param name="maxInclusive">50.1</param>
* <message>Age needs to be between ${minInclusive} and ${maxInclusive} (inclusive)</message>
* </validator>
*
* <!-- Field Validator Syntax -->
* <field name="percentage">
* <field-validator type="double">
* <param name="minExclusive">0.123</param>
* <param name="maxExclusive">99.98</param>
* <message>Percentage needs to be between ${minExclusive} and ${maxExclusive} (exclusive)</message>
* </field-validator>
* </field>
*
* <!-- Field Validator Syntax with expression -->
* <field name="percentage">
* <field-validator type="double">
* <param name="minExclusiveExpression">${minExclusiveValue}</param> <!-- will be evaluated as: Double getMinExclusiveValue() -->
* <param name="maxExclusiveExpression">${maxExclusiveValue}</param> <!-- will be evaluated as: Double getMaxExclusiveValue() -->
* <message>Percentage needs to be between ${minExclusive} and ${maxExclusive} (exclusive)</message>
* </field-validator>
* </field>
* </validators>
*
*