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

br.com.anteros.bean.validation.CascadingPropertyValidator Maven / Gradle / Ivy

There is a newer version: 1.0.18
Show newest version
/*******************************************************************************
 * Copyright 2012 Anteros Tecnologia
 *  
 * Licensed 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 br.com.anteros.bean.validation;

import java.util.Set;

import br.com.anteros.validation.api.ConstraintViolation;
import br.com.anteros.validation.api.Valid;
import br.com.anteros.validation.api.Validator;

/**
 * Per the bean validation spec, {@link Valid} is not honored by the
 * {@link #validateProperty(Object, String, Class...)} and
 * {@link #validateValue(Class, String, Object, Class...)} methods. The
 * {@link CascadingPropertyValidator} interface thus defines a {@link Validator} that
 * provides corresponding methods that may honor {@link Valid}.
 * It should be noted that {@link Validator#validateProperty(Object, String, Class...)}
 * and {@link Validator#validateValue(Class, String, Object, Class...)} are assumed
 * semantically equivalent to calling the {@link CascadingPropertyValidator}-defined
 * methods with cascade == false.
 * 
 * @version $Rev: 993539 $ $Date: 2010-09-07 16:27:50 -0500 (Tue, 07 Sep 2010) $
 */
public interface CascadingPropertyValidator extends Validator {

    /**
     * Validates all constraints placed on object's
     * propertyName property, with optional validation cascading.
     * 
     * @param 
     * @param object
     * @param propertyName
     * @param cascade
     * @param groups
     * @return the resulting {@link Set} of {@link ConstraintViolation}s.
     */
     java.util.Set> validateProperty(T object,
        String propertyName, boolean cascade, java.lang.Class... groups);

    /**
     * Validates all constraints placed on object's
     * propertyName property, with optional validation cascading,
     * given a hypothetical property value.
     * 
     * @param 
     * @param beanType
     * @param propertyName
     * @param value
     * @param cascade
     * @param groups
     * @return the resulting {@link Set} of {@link ConstraintViolation}s.
     */
     java.util.Set> validateValue(
        java.lang.Class beanType, String propertyName, Object value, boolean cascade, java.lang.Class... groups);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy