Package org.cip4.lib.xjdf
Class XJmfMessage
java.lang.Object
org.cip4.lib.xjdf.XJmfMessage
This class provides functionality all about XJMF Messages.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.XJmfMessage(byte[] bytes) Custom Constructor.XJmfMessage(XJMF xjmf) Custom Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(@NotNull Message message) Add a specific to the XJMF Message object.<T extends Message>
TgetMessage(Class<T> type) Return the typed message in the XJMF body.Return the list of all specific messages contained by this XJMF Message.getXJmf()Returns the XJMF Messages XJMF root node.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.
-
Constructor Details
-
XJmfMessage
public XJmfMessage()Default constructor.
Creates an XJMF Message initialized with default values. -
XJmfMessage
Custom Constructor.
Accepting an XJMF Message as byte array for initializing.- Parameters:
bytes- The XJMF Message as byte array.- Throws:
XJdfParseException
-
XJmfMessage
Custom Constructor.
Accepting an XJMF root node for initializing.- Parameters:
xjmf- The XJMF root node.
-
-
Method Details
-
getXJmf
Returns the XJMF Messages XJMF root node.- Returns:
- The XJMF root node.
-
addMessage
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
Return the typed message in the XJMF body.- Parameters:
type- The message's type.- Returns:
- The typed message.
- Throws:
XJmfMessageException
-
getMessages
Return the list of all specific messages contained by this XJMF Message.- Returns:
- List of specific messages.
-
toXml
Returns the current XJMF Message as XML byte array.- Returns:
- The XJDF Document as XML byte array.
- Throws:
XJdfParseExceptionXJdfValidationException
-
toXml
Returns 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
-