public static <A extends Annotation> ConfiguredConstraint<A> forParameter(ConstraintDef<?, A> constraint, Executable executable, int parameterIndex) { return new ConfiguredConstraint<>( constraint, ConstraintLocation.forParameter( executable, parameterIndex ), ExecutableHelper.getElementType( executable ) ); }
public static <A extends Annotation> ConfiguredConstraint<A> forCrossParameter(ConstraintDef<?, A> constraint, Executable executable) { return new ConfiguredConstraint<>( constraint, ConstraintLocation.forCrossParameter( executable ), ExecutableHelper.getElementType( executable ) ); }
public static <A extends Annotation> ConfiguredConstraint<A> forExecutable(ConstraintDef<?, A> constraint, Executable executable) { return new ConfiguredConstraint<>( constraint, ConstraintLocation.forReturnValue( executable ), ExecutableHelper.getElementType( executable ) ); }
CascadingMetaDataBuilder build( Executable executable, Set<MetaConstraint<?>> returnValueConstraints, Set<MetaConstraint<?>> returnValueTypeArgumentConstraints) { ConstraintLocation constraintLocation = ConstraintLocation.forReturnValue( executable ); returnValueConstraints.addAll( constraintTypeStaxBuilders.stream() .map( builder -> builder.build( constraintLocation, ExecutableHelper.getElementType( executable ), ConstraintDescriptorImpl.ConstraintType.GENERIC ) ) .collect( Collectors.toSet() ) ); ContainerElementTypeConfiguration containerElementTypeConfiguration = getContainerElementTypeConfiguration( ReflectionHelper.typeOf( executable ), constraintLocation ); returnValueTypeArgumentConstraints.addAll( containerElementTypeConfiguration.getMetaConstraints() ); // ignore annotations if ( ignoreAnnotations.isPresent() ) { annotationProcessingOptions.ignoreConstraintAnnotationsForReturnValue( executable, ignoreAnnotations.get() ); } return getCascadingMetaData( containerElementTypeConfiguration.getTypeParametersCascadingMetaData(), ReflectionHelper.typeOf( executable ) ); } }
List<ConstrainedParameter> parameterConstraints = getParameterMetaData( executable ); Map<ConstraintType, List<ConstraintDescriptorImpl<?>>> executableConstraints = findConstraints( executable, ExecutableHelper.getElementType( executable ) ) .stream() .collect( Collectors.groupingBy( ConstraintDescriptorImpl::getConstraintType ) );