All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dashbuilder.dataset.validation.IsTimeIntervalImpl Maven / Gradle / Ivy

The newest version!
package org.dashbuilder.dataset.validation;

import org.dashbuilder.dataset.date.TimeAmount;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 

JSR303 annotation implementation for org.dashbuilder.common.shared.validation.IsTimeInterval.

*/ public class IsTimeIntervalImpl implements ConstraintValidator { @Override public void initialize(IsTimeInterval constraintAnnotation) { // Do nothing. } @Override public boolean isValid(String value, ConstraintValidatorContext context) { if (value != null && value.trim().length() > 0) { try { TimeAmount.parse(value); } catch (IllegalArgumentException e) { return false; } } return true; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy