Package org.cip4.lib.xjdf
Class XJmfMessage
- java.lang.Object
-
- org.cip4.lib.xjdf.XJmfMessage
-
public class XJmfMessage extends java.lang.ObjectThis 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 voidaddMessage(@NotNull Message message)Add a specific to the XJMF Message object.java.util.List<Message>getMessages()Return the list of all specific messages contained by this XJMF Message.XJMFgetXJmf()Returns the XJMF Messages XJMF root node.java.lang.StringtoString()byte[]toXml()Returns the current XJMF Message as XML byte array.byte[]toXml(boolean validate)Returns the current XJDF Document as XML byte array.
-
-
-
Constructor Detail
-
XJmfMessage
public XJmfMessage()
Default constructor.
Creates an XJMF Message initialized with default values.
-
XJmfMessage
public XJmfMessage(byte[] bytes) throws XJdfParseExceptionCustom 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.
-
getMessages
public java.util.List<Message> getMessages()
Return the list of all specific messages contained by this XJMF Message.- Returns:
- List of specific messages.
-
toXml
public byte[] toXml() throws XJdfParseException, XJdfValidationExceptionReturns the current XJMF Message as XML byte array.- Returns:
- The XJDF Document as XML byte array.
- Throws:
XJdfParseExceptionXJdfValidationException
-
toXml
public byte[] toXml(boolean validate) throws XJdfParseException, XJdfValidationExceptionReturns the current XJDF Document as XML byte array.- Parameters:
validate- 'false' in case validation should be skipped.- Returns:
- The XJDF Document as XML byte array.
- Throws:
XJdfParseExceptionXJdfValidationException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-