Class TypeConstraintMappingContextImpl<C>

    • Method Detail

      • ignoreAnnotations

        public TypeConstraintMappingContext<C> ignoreAnnotations​(boolean ignoreAnnotations)
        Description copied from interface: AnnotationIgnoreOptions
        Specifies whether annotations at the given element should be ignored or not, overriding any setting given for parent elements. E.g. the setting given for a method parameter overrides the setting given for the method declaring that parameter.
        Specified by:
        ignoreAnnotations in interface AnnotationIgnoreOptions<C>
        Parameters:
        ignoreAnnotations - Whether to ignore annotation-based constraints or not.
        Returns:
        This context for method chaining.
      • property

        @Deprecated
        public PropertyConstraintMappingContext property​(String property,
                                                         ElementType elementType)
        Deprecated.
        Description copied from interface: PropertyTarget
        Selects a property to which the next operations shall apply.

        Until this method is called constraints apply on class level. After calling this method constraints apply on the specified property with the given access type.

        A given property may only be configured once.

        Specified by:
        property in interface PropertyTarget
        Parameters:
        property - The property on which to apply the following constraints (Java Bean notation).
        elementType - The access type (field/property).
        Returns:
        A creational context representing the selected property.
      • field

        public PropertyConstraintMappingContext field​(String property)
        Description copied from interface: PropertyTarget
        Selects a field to which the next operations shall apply.

        Until this method is called constraints apply on class level. After calling this method constraints apply on the specified field property.

        A given field may only be configured once.

        Specified by:
        field in interface PropertyTarget
        Parameters:
        property - The field name that represents a property on which to apply the following constraints.
        Returns:
        A creational context representing the selected field property.
      • getter

        public PropertyConstraintMappingContext getter​(String property)
        Description copied from interface: PropertyTarget
        Selects a getter to which the next operations shall apply.

        Until this method is called constraints apply on class level. After calling this method constraints apply on the specified getter property.

        A given getter may only be configured once.

        Specified by:
        getter in interface PropertyTarget
        Parameters:
        property - The getter property name (using the Java Bean notation, e.g. name to address getName()) that represents a property on which to apply the following constraints.
        Returns:
        A creational context representing the selected getter property.
      • method

        public MethodConstraintMappingContext method​(String name,
                                                     Class<?>... parameterTypes)
        Description copied from interface: MethodTarget
        Selects a method to which the next operations shall apply.

        Until this method is called constraints apply on class level. After calling this method constraints apply to the specified method.

        A given method may only be configured once.

        Specified by:
        method in interface MethodTarget
        Parameters:
        name - The method name.
        parameterTypes - The method parameter types.
        Returns:
        A creational context representing the selected method.
      • constructor

        public ConstructorConstraintMappingContext constructor​(Class<?>... parameterTypes)
        Description copied from interface: ConstructorTarget
        Selects a constructor to which the next operations shall apply.

        Until this method is called constraints apply on class level. After calling this method constraints apply to the specified constructor.

        A given constructor may only be configured once.

        Specified by:
        constructor in interface ConstructorTarget
        Parameters:
        parameterTypes - The constructor parameter types.
        Returns:
        A creational context representing the selected constructor.
      • getConstraintType

        protected ConstraintDescriptorImpl.ConstraintType getConstraintType()
        Returns the type of constraints hosted on the element configured by this creational context.
        Returns:
        the type of constraints hosted on the element configured by this creational context
      • addConstraint

        protected void addConstraint​(org.hibernate.validator.internal.cfg.context.ConfiguredConstraint<?> constraint)
        Adds a constraint to the set of constraints managed by this creational context.
        Parameters:
        constraint - the constraint to add