Validation rules for number, integer and currency attribute types

To better control the validation of number, currency and integer attribute types, you can use a set of facets.

The mandatory and optional facets are:

  • Total number of digits
  • Fraction digits
  • Maximum Value (exclusive)
  • Maximum Value (inclusive)
  • Minimum Value (exclusive)
  • Minimum Value (inclusive)

If the mandatory facets are not used, the attributes will be validated as before. It is not recommended to introduce these new facets on existing specs.

Number and currency attribute types

The number and currency attribute types has the following mandatory facets:
  • Total number of digits
  • Fraction digits
The number and currency attribute types has the following optional facets (zero or more):
  • Maximum Value (exclusive)
  • Maximum Value (inclusive)
  • Minimum Value (exclusive)
  • Minimum Value (inclusive)

You must use both of these mandatory facets to be able to enforce the new validation rules for number and currency attribute types. If you use both of the mandatory facets, Maxlength and Precision are not used for validation. In addition, you can use one or more of the optional facets.

Restriction: The optional facets are used for validation if and only if both the mandatory facets are used.

Attributes of type integer

The integer attribute type has the following mandatory facet:
  • Total number of digits
The integer attribute type has the following optional facets:
  • Maximum Value (exclusive)
  • Maximum Value (inclusive)
  • Minimum Value (exclusive)
  • Minimum Value (inclusive)

You must use the mandatory facet to be able to enforce the new validation rules for integer attribute types. If you use the mandatory facet, Maxlength is not used for validation. In addition, you can use one or more of the optional facets.

Restriction: The optional facets are used for validation if and only if the mandatory facet is used.