Search in sources :

Example 1 with IntegerValidator

use of com.sun.identity.shared.validation.IntegerValidator in project OpenAM by OpenRock.

the class FSIDPAuthenticationContextInfo method setLevel.

/**
     * Sets level.
     *
     * @param level Strength level.
     * @throws FSException if <code>level</code> is not
     *         an integer.
     */
public void setLevel(String level) throws FSException {
    IntegerValidator validator = IntegerValidator.getInstance();
    try {
        validator.validate(level);
        this.level = Integer.parseInt(level);
    } catch (ValidationException e) {
        throw new FSException(IFSConstants.META_INVALID_LEVEL, null);
    }
}
Also used : IntegerValidator(com.sun.identity.shared.validation.IntegerValidator) ValidationException(com.sun.identity.shared.validation.ValidationException) FSException(com.sun.identity.federation.common.FSException)

Aggregations

FSException (com.sun.identity.federation.common.FSException)1 IntegerValidator (com.sun.identity.shared.validation.IntegerValidator)1 ValidationException (com.sun.identity.shared.validation.ValidationException)1