Class XJmfMessage


  • public class XJmfMessage
    extends java.lang.Object
    This class provides functionality all about XJMF Messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      XJmfMessage()
      Default constructor.
      XJmfMessage​(byte[] bytes)
      Custom Constructor.
      XJmfMessage​(XJMF xjmf)
      Custom Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMessage​(@NotNull Message message)
      Add a specific to the XJMF Message object.
      <T extends Message>
      T
      getMessage​(java.lang.Class<T> type)
      Return the typed message in the XJMF body.
      java.util.List<Message> getMessages()
      Return the list of all specific messages contained by this XJMF Message.
      XJMF getXJmf()
      Returns the XJMF Messages XJMF root node.
      java.lang.String toString()  
      byte[] toXml()
      Returns the current XJMF Message as XML byte array.
      byte[] toXml​(boolean validate)
      Returns the current XJDF Document as XML byte array.
      • Methods inherited from class java.lang.Object

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

      • XJmfMessage

        public XJmfMessage()
        Default constructor.
        Creates an XJMF Message initialized with default values.
      • XJmfMessage

        public XJmfMessage​(byte[] bytes)
                    throws XJdfParseException
        Custom Constructor.
        Accepting an XJMF Message as byte array for initializing.
        Parameters:
        bytes - The XJMF Message as byte array.
        Throws:
        XJdfParseException
      • XJmfMessage

        public XJmfMessage​(XJMF xjmf)
        Custom Constructor.
        Accepting an XJMF root node for initializing.
        Parameters:
        xjmf - The XJMF root node.
    • Method Detail

      • getXJmf

        public XJMF getXJmf()
        Returns the XJMF Messages XJMF root node.
        Returns:
        The XJMF root node.
      • addMessage

        public void addMessage​(@NotNull
                               @NotNull Message message)
        Add a specific to the XJMF Message object.
        Parameters:
        message - The message to be added. NOTE: If no header is present, a default one will be created.
      • getMessage

        public <T extends Message> T getMessage​(java.lang.Class<T> type)
                                         throws XJmfMessageException
        Return the typed message in the XJMF body.
        Parameters:
        type - The message's type.
        Returns:
        The typed message.
        Throws:
        XJmfMessageException
      • getMessages

        public java.util.List<Message> getMessages()
        Return the list of all specific messages contained by this XJMF Message.
        Returns:
        List of specific messages.
      • toString

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