public ConstraintViolationCreationContext(String message, PathImpl property, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, Object dynamicPayload) { this.message = message; this.propertyPath = property; this.messageParameters = toImmutableMap( messageParameters ); this.expressionVariables = toImmutableMap( expressionVariables ); this.dynamicPayload = dynamicPayload; }
public MessageInterpolatorContext(ConstraintDescriptor<?> constraintDescriptor, Object validatedValue, Class<?> rootBeanType, Map<String, Object> messageParameters, Map<String, Object> expressionVariables) { this.constraintDescriptor = constraintDescriptor; this.validatedValue = validatedValue; this.rootBeanType = rootBeanType; this.messageParameters = toImmutableMap( messageParameters ); this.expressionVariables = toImmutableMap( expressionVariables ); }
public ConstraintViolationCreationContext(String message, PathImpl property, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, Object dynamicPayload) { this.message = message; this.propertyPath = property; this.messageParameters = toImmutableMap( messageParameters ); this.expressionVariables = toImmutableMap( expressionVariables ); this.dynamicPayload = dynamicPayload; }
public BeanDescriptorImpl(Type beanClass, Set<ConstraintDescriptorImpl<?>> classLevelConstraints, Map<String, PropertyDescriptor> constrainedProperties, Map<String, ExecutableDescriptorImpl> constrainedMethods, Map<String, ConstructorDescriptor> constrainedConstructors, boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence) { super( beanClass, classLevelConstraints, defaultGroupSequenceRedefined, defaultGroupSequence ); this.constrainedProperties = CollectionHelper.toImmutableMap( constrainedProperties ); this.constrainedMethods = CollectionHelper.toImmutableMap( constrainedMethods ); this.constrainedConstructors = CollectionHelper.toImmutableMap( constrainedConstructors ); }
public MessageInterpolatorContext(ConstraintDescriptor<?> constraintDescriptor, Object validatedValue, Class<?> rootBeanType, Map<String, Object> messageParameters, Map<String, Object> expressionVariables) { this.constraintDescriptor = constraintDescriptor; this.validatedValue = validatedValue; this.rootBeanType = rootBeanType; this.messageParameters = toImmutableMap( messageParameters ); this.expressionVariables = toImmutableMap( expressionVariables ); }
private GroupConversionHelper(Map<Class<?>, Class<?>> groupConversions) { this.groupConversions = CollectionHelper.toImmutableMap( groupConversions ); }
public final Map<String, String> getConfigProperties() { return CollectionHelper.toImmutableMap( configProperties ); }
/** * constructor. * * @param message validation message * @param property path of the field * @param messageParameters map of message parameters * @param expressionVariables map of expression variables * @param dynamicPayload object of the payload */ public ConstraintViolationCreationContext(final String message, final PathImpl property, final Map<String, Object> messageParameters, final Map<String, Object> expressionVariables, final Object dynamicPayload) { this.message = message; propertyPath = property; this.messageParameters = toImmutableMap(messageParameters); this.expressionVariables = toImmutableMap(expressionVariables); this.dynamicPayload = dynamicPayload; }
private CascadingMetaDataBuilder(Type enclosingType, TypeVariable<?> typeParameter, Class<?> declaredContainerClass, TypeVariable<?> declaredTypeParameter, boolean cascading, Map<TypeVariable<?>, CascadingMetaDataBuilder> containerElementTypesCascadingMetaData, Map<Class<?>, Class<?>> groupConversions) { this.enclosingType = enclosingType; this.typeParameter = typeParameter; this.declaredContainerClass = declaredContainerClass; this.declaredTypeParameter = declaredTypeParameter; this.cascading = cascading; this.groupConversions = CollectionHelper.toImmutableMap( groupConversions ); this.containerElementTypesCascadingMetaData = CollectionHelper.toImmutableMap( containerElementTypesCascadingMetaData ); boolean tmpHasContainerElementsMarkedForCascading = false; boolean tmpHasGroupConversionsOnAnnotatedObjectOrContainerElements = !groupConversions.isEmpty(); for ( CascadingMetaDataBuilder nestedCascadingTypeParameter : containerElementTypesCascadingMetaData.values() ) { tmpHasContainerElementsMarkedForCascading = tmpHasContainerElementsMarkedForCascading || nestedCascadingTypeParameter.cascading || nestedCascadingTypeParameter.hasContainerElementsMarkedForCascading; tmpHasGroupConversionsOnAnnotatedObjectOrContainerElements = tmpHasGroupConversionsOnAnnotatedObjectOrContainerElements || nestedCascadingTypeParameter.hasGroupConversionsOnAnnotatedObjectOrContainerElements; } hasContainerElementsMarkedForCascading = tmpHasContainerElementsMarkedForCascading; hasGroupConversionsOnAnnotatedObjectOrContainerElements = tmpHasGroupConversionsOnAnnotatedObjectOrContainerElements; }
/** * Returns the bindings for all the type variables from the given type's hierarchy. The returned map will contain an * entry for each type in the given type's class hierarchy (including interfaces). Each entry is a map from the * given type's type variables to the corresponding type variables of the type represented by that entry. */ public static Map<Class<?>, Map<TypeVariable<?>, TypeVariable<?>>> getTypeVariableBindings(Class<?> type) { Map<Class<?>, Map<TypeVariable<?>, TypeVariable<?>>> allBindings = new HashMap<>(); Map<TypeVariable<?>, TypeVariable<?>> currentBindings = new HashMap<>(); TypeVariable<?>[] subTypeParameters = type.getTypeParameters(); for ( TypeVariable<?> typeVariable : subTypeParameters ) { currentBindings.put( typeVariable, typeVariable ); } allBindings.put( type, currentBindings ); collectTypeBindings( type, allBindings, currentBindings ); allBindings.put( Object.class, Collections.emptyMap() ); return CollectionHelper.toImmutableMap( allBindings ); }
@Override public Map<String, Object> run() { final Method[] declaredMethods = annotation.annotationType().getDeclaredMethods(); Map<String, Object> attributes = newHashMap( declaredMethods.length ); for ( Method m : declaredMethods ) { // HV-1184 Exclude synthetic methods potentially introduced by jacoco if ( m.isSynthetic() ) { continue; } m.setAccessible( true ); String attributeName = m.getName(); try { attributes.put( m.getName(), m.invoke( annotation ) ); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw LOG.getUnableToGetAnnotationAttributeException( annotation.getClass(), attributeName, e ); } } return CollectionHelper.toImmutableMap( attributes ); } }
private AnnotationDescriptor(Class<A> annotationType, Map<String, Object> attributes) { this.type = annotationType; this.attributes = CollectionHelper.toImmutableMap( attributes ); this.hashCode = buildHashCode(); this.annotation = AnnotationFactory.create( this ); }
public ProgrammaticMetaDataProvider(ConstraintHelper constraintHelper, TypeResolutionHelper typeResolutionHelper, ValueExtractorManager valueExtractorManager, Set<DefaultConstraintMapping> constraintMappings) { Contracts.assertNotNull( constraintMappings ); configuredBeans = CollectionHelper.toImmutableMap( createBeanConfigurations( constraintMappings, constraintHelper, typeResolutionHelper, valueExtractorManager ) ); assertUniquenessOfConfiguredTypes( constraintMappings ); annotationProcessingOptions = mergeAnnotationProcessingOptions( constraintMappings ); }
public XmlMetaDataProvider(ConstraintHelper constraintHelper, TypeResolutionHelper typeResolutionHelper, ValueExtractorManager valueExtractorManager, Set<InputStream> mappingStreams, ClassLoader externalClassLoader) { MappingXmlParser mappingParser = new MappingXmlParser( constraintHelper, typeResolutionHelper, valueExtractorManager, externalClassLoader ); mappingParser.parse( mappingStreams ); configuredBeans = CollectionHelper.toImmutableMap( createBeanConfigurations( mappingParser ) ); annotationProcessingOptions = mappingParser.getAnnotationProcessingOptions(); }
this.executableMetaDataMap = CollectionHelper.toImmutableMap( bySignature( executableMetaDataSet ) ); this.unconstrainedExecutables = CollectionHelper.toImmutableSet( tmpUnconstrainedExecutables );