Class Validator


  • public class Validator
    extends Object
    Utility class that validates an object
    • Constructor Detail

      • Validator

        public Validator()
    • Method Detail

      • getPropertyNamePrefix

        public String getPropertyNamePrefix()
      • hasPropertyValidationFor

        public boolean hasPropertyValidationFor​(CustomField<?,​?,​?> field)
        Returns:
        true if this validator already has some property validation for the specified custom field.
      • hasValidationFor

        public boolean hasValidationFor​(Property<?,​?> property)
        Returns:
        true if this validator already has some property validation for the specified property bean.
      • hasValidationFor

        public boolean hasValidationFor​(com.querydsl.core.types.Path<?> path)
        Returns:
        true if this validator already has some property validation for the specified entity path.
      • nested

        public Validator nested​(Property<?,​?> property,
                                Validator validator)
        Adds a nested validator for the bean retrieved through the given list property validating all elements in the list
      • nested

        public Validator nested​(PropertyAccess propertyAccess,
                                Validator validator)
        Adds a nested validator for the bean retrieved through the given property access. When the value is a collection, validates all elements in it
      • property

        public Property property​(Property<?,​?> property,
                                 MessageKey key)
        Adds a bean property validation, or, if already added, returns the previous one
      • property

        public Property property​(Property<?,​?> property,
                                 NamedEntity label)
        Adds a bean property validation, or, if already added, returns the previous one
      • property

        public Property property​(com.querydsl.core.types.Path<?> path,
                                 MessageKey key)
        Adds a bean property validation, or, if already added, returns the previous one
      • property

        public Property property​(com.querydsl.core.types.Path<?> path,
                                 NamedEntity label)
        Adds a bean property validation, or, if already added, returns the previous one
      • property

        public Property property​(com.querydsl.core.types.Path<?> path,
                                 TranslationMessageSpecification message)
        Adds a bean property validation, or, if already added, returns the previous one
      • property

        public Property property​(PropertyAccess propertyAccess,
                                 MessageKey key)
        Adds a property validation that uses the given property access to reach it.
      • property

        public Property property​(PropertyAccess propertyAccess,
                                 NamedEntity label)
        Adds a property validation that uses the given property access to reach it.
      • setPropertyNamePrefix

        public void setPropertyNamePrefix​(String propertyNamePrefix)
      • propertyInternal

        protected Property propertyInternal​(PropertyAccess propertyAccess,
                                            Object display)
        Adds a property validation that uses the given property access to reach it.
      • resolveDisplayName

        protected String resolveDisplayName​(FormatterImpl formatter,
                                            Property property,
                                            Object object)
        Returns the display name of a given property
      • resolveGeneralMessage

        protected String resolveGeneralMessage​(FormatterImpl formatter,
                                               ValidationError error)
        Returns the translation message for a given general error