Class ContainerElementConstraintMappingContextImpl

    • Method Detail

      • 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.
      • 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.
      • 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.
      • parameter

        public ParameterConstraintMappingContext parameter​(int index)
        Description copied from interface: ParameterTarget
        Changes the parameter for which added constraints apply. A given parameter may only be configured once.
        Specified by:
        parameter in interface ParameterTarget
        Parameters:
        index - The parameter index.
        Returns:
        A creational context representing the selected parameter.
      • returnValue

        public ReturnValueConstraintMappingContext returnValue()
        Description copied from interface: ReturnValueTarget
        Selects the current method's return value as the target for the next operations. The return value of one method or constructor may only be configured more once.
        Specified by:
        returnValue in interface ReturnValueTarget
        Returns:
        A creational context representing the current method's or constructor's return value.
      • containerElementType

        public ContainerElementConstraintMappingContext containerElementType()
        Description copied from interface: ContainerElementTarget
        Selects the single type argument of the current element's generic type as the target for the next operations. Selects the component type if the current element is of an array type.
        Specified by:
        containerElementType in interface ContainerElementTarget
        Returns:
        A creational context representing the single type argument or the component type of the current element's type.
      • containerElementType

        public ContainerElementConstraintMappingContext containerElementType​(int index,
                                                                             int... nestedIndexes)
        Description copied from interface: ContainerElementTarget
        Selects the single type argument of the current element's generic type as the target for the next operations. Selects the component type if the current element is of an array type.
        Specified by:
        containerElementType in interface ContainerElementTarget
        Parameters:
        index - The index of the type argument to configure. Pass 0 when navigating into an array type.
        nestedIndexes - the nested index(es) in case the container element to configure is a generic type within another generic type, e.g. List<Map<String, String>>, a multi-dimensional array or a combination of (nested) parameterized and array types.
        Returns:
        A creational context representing the specified type argument.
      • 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
      • addGroupConversion

        public void addGroupConversion​(Class<?> from,
                                       Class<?> to)
        Adds a group conversion for this element.
        Parameters:
        from - the source group of the conversion
        to - the target group of the conversion
      • valid

        public C valid()
        Description copied from interface: Cascadable
        Marks the current element (property, parameter etc.) as cascadable.
        Specified by:
        valid in interface Cascadable<C extends Cascadable<C>>
        Returns:
        The current creational context following the method chaining pattern.
      • convertGroup

        public GroupConversionTargetContext<C> convertGroup​(Class<?> from)
        Description copied from interface: Cascadable
        Adds a group conversion for this cascadable element. Several conversions may be configured for one element.
        Specified by:
        convertGroup in interface Cascadable<C extends Cascadable<C>>
        Parameters:
        from - the source group of the conversion to be configured
        Returns:
        a creational context allow to set the target group of the conversion
      • isCascading

        public boolean isCascading()
      • 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