public MethodValidationConfiguration build() { return new MethodValidationConfiguration( allowOverridingMethodAlterParameterConstraint, allowMultipleCascadedValidationOnReturnValues, allowParallelMethodsDefineParameterConstraints ); } }
public boolean isAllowMultipleCascadedValidationOnReturnValues() { return this.methodValidationConfiguration.isAllowMultipleCascadedValidationOnReturnValues(); }
public boolean isAllowOverridingMethodAlterParameterConstraint() { return this.methodValidationConfiguration.isAllowOverridingMethodAlterParameterConstraint(); }
.isAllowOverridingMethodAlterParameterConstraint(); tmpAllowMultipleCascadedValidationOnReturnValues = hibernateSpecificConfig.getMethodValidationConfiguration() .isAllowMultipleCascadedValidationOnReturnValues(); tmpAllowParallelMethodsDefineParameterConstraints = hibernateSpecificConfig.getMethodValidationConfiguration() .isAllowParallelMethodsDefineParameterConstraints(); this.methodValidationConfiguration = new MethodValidationConfiguration(); tmpAllowOverridingMethodAlterParameterConstraint ); this.methodValidationConfiguration.allowOverridingMethodAlterParameterConstraint( tmpAllowOverridingMethodAlterParameterConstraint ); tmpAllowMultipleCascadedValidationOnReturnValues ); this.methodValidationConfiguration.allowMultipleCascadedValidationOnReturnValues( tmpAllowMultipleCascadedValidationOnReturnValues ); tmpAllowParallelMethodsDefineParameterConstraints ); this.methodValidationConfiguration.allowParallelMethodsDefineParameterConstraints( tmpAllowParallelMethodsDefineParameterConstraints );
/** * Return an unmodifiable Set of MethodConfigurationRule that are to be * enforced based on the configuration. * * @return a set of method configuration rules based on this configuration state */ public Set<MethodConfigurationRule> getConfiguredRuleSet() { HashSet<MethodConfigurationRule> result = newHashSet(); if ( !this.isAllowOverridingMethodAlterParameterConstraint() ) { result.add( new OverridingMethodMustNotAlterParameterConstraints() ); } if ( !this.isAllowParallelMethodsDefineParameterConstraints() ) { result.add( new ParallelMethodsMustNotDefineParameterConstraints() ); } result.add( new VoidMethodsMustNotBeReturnValueConstrained() ); if ( !this.isAllowMultipleCascadedValidationOnReturnValues() ) { result.add( new ReturnValueMayOnlyBeMarkedOnceAsCascadedPerHierarchyLine() ); } result.add( new ParallelMethodsMustNotDefineGroupConversionForCascadedReturnValue() ); return Collections.unmodifiableSet( result ); } }
public boolean isAllowParallelMethodsDefineParameterConstraints() { return this.methodValidationConfiguration.isAllowParallelMethodsDefineParameterConstraints(); }
/** * Creates a new builder based on the given executable meta data. * * @param constrainedExecutable The base executable for this builder. This is the lowest * executable with a given signature within a type hierarchy. * @param constraintHelper the constraint helper * @param executableHelper the executable helper * @param beanClass the bean class * @param methodValidationConfiguration configuration instance for method validation behaviour */ public Builder( Class<?> beanClass, ConstrainedExecutable constrainedExecutable, ConstraintHelper constraintHelper, ExecutableHelper executableHelper, MethodValidationConfiguration methodValidationConfiguration) { super( beanClass, constraintHelper ); this.executableHelper = executableHelper; this.kind = constrainedExecutable.getKind(); this.executable = constrainedExecutable.getExecutable(); this.rules = new HashSet<MethodConfigurationRule>( methodValidationConfiguration.getConfiguredRuleSet() ); add( constrainedExecutable ); }
@Override public HibernateValidatorConfiguration allowOverridingMethodAlterParameterConstraint(boolean allow) { this.methodValidationConfiguration.allowOverridingMethodAlterParameterConstraint( allow ); return this; }
@Override public HibernateValidatorConfiguration allowMultipleCascadedValidationOnReturnValues(boolean allow) { this.methodValidationConfiguration.allowMultipleCascadedValidationOnReturnValues( allow ); return this; }
@Override public HibernateValidatorConfiguration allowParallelMethodsDefineParameterConstraints(boolean allow) { this.methodValidationConfiguration.allowParallelMethodsDefineParameterConstraints( allow ); return this; }
private MethodValidationConfiguration(boolean allowOverridingMethodAlterParameterConstraint, boolean allowMultipleCascadedValidationOnReturnValues, boolean allowParallelMethodsDefineParameterConstraints) { this.allowOverridingMethodAlterParameterConstraint = allowOverridingMethodAlterParameterConstraint; this.allowMultipleCascadedValidationOnReturnValues = allowMultipleCascadedValidationOnReturnValues; this.allowParallelMethodsDefineParameterConstraints = allowParallelMethodsDefineParameterConstraints; this.configuredRuleSet = buildConfiguredRuleSet( allowOverridingMethodAlterParameterConstraint, allowMultipleCascadedValidationOnReturnValues, allowParallelMethodsDefineParameterConstraints ); }
@Override public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } BeanMetaDataManagerKey other = (BeanMetaDataManagerKey) obj; return methodValidationConfiguration.equals( other.methodValidationConfiguration ) && parameterNameProvider.equals( other.parameterNameProvider ) && valueExtractorManager.equals( other.valueExtractorManager ); }
private static boolean getAllowParallelMethodsDefineParameterConstraints(ConfigurationImpl hibernateSpecificConfig, Map<String, String> properties) { return checkPropertiesForBoolean( properties, HibernateValidatorConfiguration.ALLOW_PARALLEL_METHODS_DEFINE_PARAMETER_CONSTRAINTS, hibernateSpecificConfig != null ? hibernateSpecificConfig.getMethodValidationConfiguration().isAllowParallelMethodsDefineParameterConstraints() : false ); }
public Builder( Class<?> beanClass, ConstrainedExecutable constrainedExecutable, ConstraintHelper constraintHelper, ExecutableHelper executableHelper, TypeResolutionHelper typeResolutionHelper, ValueExtractorManager valueExtractorManager, ExecutableParameterNameProvider parameterNameProvider, MethodValidationConfiguration methodValidationConfiguration) { super( beanClass, constraintHelper, typeResolutionHelper, valueExtractorManager ); this.executableHelper = executableHelper; this.parameterNameProvider = parameterNameProvider; this.kind = constrainedExecutable.getKind(); this.executable = constrainedExecutable.getExecutable(); this.rules = methodValidationConfiguration.getConfiguredRuleSet(); this.isGetterMethod = constrainedExecutable.isGetterMethod(); add( constrainedExecutable ); }
@Override public HibernateValidatorContext allowOverridingMethodAlterParameterConstraint(boolean allow) { this.methodValidationConfiguration.allowOverridingMethodAlterParameterConstraint( allow ); return this; }
@Override public HibernateValidatorContext allowMultipleCascadedValidationOnReturnValues(boolean allow) { this.methodValidationConfiguration.allowMultipleCascadedValidationOnReturnValues( allow ); return this; }
@Override public HibernateValidatorContext allowParallelMethodsDefineParameterConstraints(boolean allow) { this.methodValidationConfiguration.allowParallelMethodsDefineParameterConstraints( allow ); return this; }
private static boolean getAllowMultipleCascadedValidationOnReturnValues(ConfigurationImpl hibernateSpecificConfig, Map<String, String> properties) { return checkPropertiesForBoolean( properties, HibernateValidatorConfiguration.ALLOW_MULTIPLE_CASCADED_VALIDATION_ON_RESULT, hibernateSpecificConfig != null ? hibernateSpecificConfig.getMethodValidationConfiguration().isAllowMultipleCascadedValidationOnReturnValues() : false ); }
private static boolean getAllowOverridingMethodAlterParameterConstraint(ConfigurationImpl hibernateSpecificConfig, Map<String, String> properties) { return checkPropertiesForBoolean( properties, HibernateValidatorConfiguration.ALLOW_PARAMETER_CONSTRAINT_OVERRIDE, hibernateSpecificConfig != null ? hibernateSpecificConfig.getMethodValidationConfiguration().isAllowOverridingMethodAlterParameterConstraint() : false ); }
/** * Creates a new {@code BeanMetaDataManager}. * * @param constraintHelper the constraint helper * @param executableHelper the executable helper * @param parameterNameProvider the parameter name provider * @param optionalMetaDataProviders optional meta data provider used on top of the annotation based provider */ public BeanMetaDataManager(ConstraintHelper constraintHelper, ExecutableHelper executableHelper, ParameterNameProvider parameterNameProvider, List<MetaDataProvider> optionalMetaDataProviders) { this( constraintHelper, executableHelper, parameterNameProvider, optionalMetaDataProviders, new MethodValidationConfiguration() ); }