Class ValidationMessagesImpl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, ValidationMessages

    public class ValidationMessagesImpl
    extends java.lang.Object
    implements ValidationMessages, java.util.Collection<java.lang.Object>, java.io.Serializable
    Collection base implementation of ValidationMessages
    Since:
    6.0.0
    Author:
    dennis
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.Object e)  
      boolean addAll​(java.util.Collection<? extends java.lang.Object> c)  
      void addMessages​(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages)
      add validation messages to component
      void addMessages​(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages, java.lang.Object value)
      add validation messages to component
      void clear()  
      void clearAllMessages()
      clear all validation message
      void clearKeyMessages​(java.lang.String key)
      clear validation message of a special message key
      void clearKeyMessages​(Component comp, java.lang.String key)
      clear validation message of component and a special message key
      void clearMessages​(Component comp)
      clear validation message of component
      void clearMessages​(Component comp, java.lang.String attr)
      clear validation message of component
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      Component getAssociate​(java.lang.String key)
      Returns the first associated component from the given key, if any.
      Component[] getAssociates​(java.lang.String key)
      Returns all associated components from the given key, if any.
      java.lang.Object getFieldValue​(java.lang.String key)
      Returns the first field value from the given key, if any.
      java.lang.Object getFieldValue​(Component comp, java.lang.String key)
      Returns the first field value from the given key and component, if any.
      java.lang.Object[] getFieldValues​(java.lang.String key)
      Returns all field values from the given key, if any.
      java.lang.Object[] getFieldValues​(Component comp, java.lang.String key)
      Returns all field values from the given key and component, if any.
      java.lang.String[] getKeyMessages​(java.lang.String key)
      get validation message of a special key
      java.lang.String[] getKeyMessages​(Component comp, java.lang.String key)
      get validation message of component and a special key
      java.lang.String[] getMessages()
      get all validation messages
      java.lang.String[] getMessages​(Component comp)
      get validation messages of a component
      java.lang.String[] getMessages​(Component comp, java.lang.String attr)
      get validation messages of a component and special attribute
      boolean isEmpty()  
      java.util.Iterator<java.lang.Object> iterator()  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      void setMessages​(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages)
      set validation messages to component, it will replace previous messages
      void setMessages​(Component comp, java.lang.String attr, java.lang.String key, java.lang.String[] messages, java.lang.Object value)
      set validation messages to component, it will replace previous messages
      int size()  
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] a)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • ValidationMessagesImpl

        public ValidationMessagesImpl()
    • Method Detail

      • getMessages

        public java.lang.String[] getMessages​(Component comp,
                                              java.lang.String attr)
        Description copied from interface: ValidationMessages
        get validation messages of a component and special attribute
        Specified by:
        getMessages in interface ValidationMessages
        Returns:
        messages. Always not null. Empty if no message in component and attribute
      • getMessages

        public java.lang.String[] getMessages​(Component comp)
        Description copied from interface: ValidationMessages
        get validation messages of a component
        Specified by:
        getMessages in interface ValidationMessages
        Returns:
        messages. Always not null. Empty if no message of component
      • getMessages

        public java.lang.String[] getMessages()
        Description copied from interface: ValidationMessages
        get all validation messages
        Specified by:
        getMessages in interface ValidationMessages
        Returns:
        messages. Always not null. Empty if no messages
      • getKeyMessages

        public java.lang.String[] getKeyMessages​(Component comp,
                                                 java.lang.String key)
        Description copied from interface: ValidationMessages
        get validation message of component and a special key
        Specified by:
        getKeyMessages in interface ValidationMessages
        Returns:
        messages. Always not null. Empty if no message of key
      • getKeyMessages

        public java.lang.String[] getKeyMessages​(java.lang.String key)
        Description copied from interface: ValidationMessages
        get validation message of a special key
        Specified by:
        getKeyMessages in interface ValidationMessages
        Returns:
        messages. Always not null. Empty if no message of key
      • setMessages

        public void setMessages​(Component comp,
                                java.lang.String attr,
                                java.lang.String key,
                                java.lang.String[] messages)
        Description copied from interface: ValidationMessages
        set validation messages to component, it will replace previous messages
        Specified by:
        setMessages in interface ValidationMessages
        Parameters:
        comp - the component refers to the messages
        attr - the attr refers to the messages
        key - the custom key refers to this messages, nullable
        messages - the messages
      • setMessages

        public void setMessages​(Component comp,
                                java.lang.String attr,
                                java.lang.String key,
                                java.lang.String[] messages,
                                java.lang.Object value)
        Description copied from interface: ValidationMessages
        set validation messages to component, it will replace previous messages
        Specified by:
        setMessages in interface ValidationMessages
        Parameters:
        comp - the component refers to the messages
        attr - the attr refers to the messages
        key - the custom key refers to this messages, nullable
        messages - the messages
        value - the rejected value
      • addMessages

        public void addMessages​(Component comp,
                                java.lang.String attr,
                                java.lang.String key,
                                java.lang.String[] messages)
        Description copied from interface: ValidationMessages
        add validation messages to component
        Specified by:
        addMessages in interface ValidationMessages
        Parameters:
        comp - the component refers to the messages
        attr - the attr refers to the messages
        key - the custom key refers to this messages, nullable
        messages - the messages
      • addMessages

        public void addMessages​(Component comp,
                                java.lang.String attr,
                                java.lang.String key,
                                java.lang.String[] messages,
                                java.lang.Object value)
        Description copied from interface: ValidationMessages
        add validation messages to component
        Specified by:
        addMessages in interface ValidationMessages
        Parameters:
        comp - the component refers to the messages
        attr - the attr refers to the messages
        key - the custom key refers to this messages, nullable
        messages - the messages
        value - the rejected value
      • getFieldValue

        public java.lang.Object getFieldValue​(java.lang.String key)
        Description copied from interface: ValidationMessages
        Returns the first field value from the given key, if any.
        Specified by:
        getFieldValue in interface ValidationMessages
        Parameters:
        key - the custom key refers to this messages, nullable
        Returns:
        value. Nullable.
      • getFieldValue

        public java.lang.Object getFieldValue​(Component comp,
                                              java.lang.String key)
        Description copied from interface: ValidationMessages
        Returns the first field value from the given key and component, if any.
        Specified by:
        getFieldValue in interface ValidationMessages
        Parameters:
        comp - the component refers to the value
        key - the custom key refers to this value, nullable
        Returns:
        value. Nullable.
      • getFieldValues

        public java.lang.Object[] getFieldValues​(java.lang.String key)
        Description copied from interface: ValidationMessages
        Returns all field values from the given key, if any.
        Specified by:
        getFieldValues in interface ValidationMessages
        Parameters:
        key - the custom key refers to this messages, nullable
        Returns:
        values. Always not null.
      • getFieldValues

        public java.lang.Object[] getFieldValues​(Component comp,
                                                 java.lang.String key)
        Description copied from interface: ValidationMessages
        Returns all field values from the given key and component, if any.
        Specified by:
        getFieldValues in interface ValidationMessages
        Parameters:
        comp - the component refers to the value
        key - the custom key refers to this value, nullable
        Returns:
        values. Always not null.
      • getAssociate

        public Component getAssociate​(java.lang.String key)
        Description copied from interface: ValidationMessages
        Returns the first associated component from the given key, if any.
        Specified by:
        getAssociate in interface ValidationMessages
        Parameters:
        key - the custom key refers to this messages, nullable
        Returns:
        component. Nullable.
      • getAssociates

        public Component[] getAssociates​(java.lang.String key)
        Description copied from interface: ValidationMessages
        Returns all associated components from the given key, if any.
        Specified by:
        getAssociates in interface ValidationMessages
        Parameters:
        key - the custom key refers to this messages, nullable
        Returns:
        components. Always not null.
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.Object>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<java.lang.Object>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<java.lang.Object>
      • iterator

        public java.util.Iterator<java.lang.Object> iterator()
        Specified by:
        iterator in interface java.util.Collection<java.lang.Object>
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Object>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<java.lang.Object>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<java.lang.Object>
      • add

        public boolean add​(java.lang.Object e)
        Specified by:
        add in interface java.util.Collection<java.lang.Object>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<java.lang.Object>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<java.lang.Object>
      • addAll

        public boolean addAll​(java.util.Collection<? extends java.lang.Object> c)
        Specified by:
        addAll in interface java.util.Collection<java.lang.Object>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<java.lang.Object>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<java.lang.Object>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<java.lang.Object>