Class Messages

  • All Implemented Interfaces:
    java.io.Serializable

    public class Messages
    extends java.lang.Object
    implements java.io.Serializable
    Set of messages.

    Uses XavaResources for doing i18n.

    Author:
    Javier Paniza
    See Also:
    XavaResources, Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Messages.Type  
    • Constructor Summary

      Constructors 
      Constructor Description
      Messages()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String idMessage, java.lang.Object... ids)  
      void add​(Messages messages)  
      void add​(Messages.Type type, java.lang.String idMessage, java.lang.Object... ids)  
      void clearAndClose()
      Clear all error message and does not accept any more messages.
      boolean contains()  
      boolean contains​(java.lang.String idMessage)  
      java.util.Collection getIds()
      List of all ids of the messages
      java.util.Collection getInfosStrings​(javax.servlet.ServletRequest request)  
      java.util.Collection getMembers()
      Qualified names of the members affected for this errors.
      java.util.Collection getMessagesStrings​(javax.servlet.ServletRequest request)  
      java.util.Collection getStrings()
      List of all message texts translated using the default locale.
      java.util.Collection getStrings​(java.util.Locale locale)
      List of all message texts translated using the indicated locale.
      java.util.Collection getStrings​(javax.servlet.ServletRequest request)
      List of all message texts translated using the locale of the request.
      java.util.Collection getWarningsStrings​(javax.servlet.ServletRequest request)  
      boolean isEmpty()  
      boolean memberHas​(MetaMember m)  
      void remove​(java.lang.String idMessage)  
      void removeAll()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Messages

        public Messages()
    • Method Detail

      • contains

        public boolean contains​(java.lang.String idMessage)
      • remove

        public void remove​(java.lang.String idMessage)
      • removeAll

        public void removeAll()
      • clearAndClose

        public void clearAndClose()
        Clear all error message and does not accept any more messages.

        If you call to add after call to this method then no exception will throw but the message will not be added.

      • add

        public void add​(java.lang.String idMessage,
                        java.lang.Object... ids)
      • add

        public void add​(Messages.Type type,
                        java.lang.String idMessage,
                        java.lang.Object... ids)
      • contains

        public boolean contains()
      • isEmpty

        public boolean isEmpty()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • add

        public void add​(Messages messages)
      • getStrings

        public java.util.Collection getStrings()
        List of all message texts translated using the default locale.
      • getStrings

        public java.util.Collection getStrings​(javax.servlet.ServletRequest request)
        List of all message texts translated using the locale of the request.
      • getStrings

        public java.util.Collection getStrings​(java.util.Locale locale)
        List of all message texts translated using the indicated locale.
      • getMessagesStrings

        public java.util.Collection getMessagesStrings​(javax.servlet.ServletRequest request)
      • getWarningsStrings

        public java.util.Collection getWarningsStrings​(javax.servlet.ServletRequest request)
      • getInfosStrings

        public java.util.Collection getInfosStrings​(javax.servlet.ServletRequest request)
      • getIds

        public java.util.Collection getIds()
        List of all ids of the messages
        Returns:
      • memberHas

        public boolean memberHas​(MetaMember m)
      • getMembers

        public java.util.Collection getMembers()
        Qualified names of the members affected for this errors.