public class ScaleConstraint extends AbstractConstraint
Manages the scale for floating point numbers (i.e., the number of digits to the right of the decimal point). Supports properties of the following types:
Modifiers | Name | Description |
---|---|---|
private int |
scale |
Fields inherited from class | Fields |
---|---|
class AbstractConstraint |
classShortName, constraintOwningClass, constraintParameter, constraintPropertyName, fullQualifiedConstraintErrorCode, fullQualifiedPrefix, messageSource, shortNameConstraintErrorCode, shortNamePrefix |
Constructor and description |
---|
ScaleConstraint
(java.lang.Class<?> constraintOwningClass, java.lang.String constraintPropertyName, java.lang.Object constraintParameter, org.springframework.context.MessageSource messageSource) |
Type Params | Return Type | Name and description |
---|---|---|
|
public java.lang.String |
getName() |
|
public int |
getScale()
|
|
private java.math.BigDecimal |
getScaledValue(java.math.BigDecimal originalValue)
|
|
protected void |
processValidate(java.lang.Object target, java.lang.Object propertyValue, org.springframework.validation.Errors errors) {@inheritDoc} |
|
public boolean |
supports(java.lang.Class type) |
|
protected java.lang.Object |
validateParameter(java.lang.Object constraintParameter) |
Methods inherited from class | Name |
---|---|
class AbstractConstraint |
checkState, getDefaultMessage, getParameter, getPropertyName, getPropertyValue, isValid, processValidate, rejectValue, rejectValue, rejectValue, rejectValue, rejectValue, rejectValueWithDefaultMessage, skipBlankValues, skipNullValues, toString, validate, validateParameter |
BigDecimal
object that results from applying the contraint's scale to the underlying numberoriginalValue
- The original value{@inheritDoc}