public class MbMessageCollection extends MbMessage
MbMessage
). The last child of
the root of the message is an element called "Collection" and has a
Collection parser associated with it. The children of the Collection element
are either name value types that do not have an associated parser or are the
root elements of Integration Bus message structures and will have an
appropriate parser associated with them. In the case of structures created
using this MbMessageCollection class, the message roots are referred to as
folders. The folders can be given any name you require and will be associated
with a CollectionFolder parser. Typically, any name value elements will
preceed any folder element children of the Collection element. The following
diagram illustrates the structure of a message collection.
+------+ | Root | (A) +--+---+ | +-----+------+ | Collection | (A) +-----+------+ | +----------+----+-------+--------------+ | | | | +--+--+ +--+--+ +----+----+ +----+----+ | nv1 | | nv2 | | folder1 | | folder2 | +-----+ +-----+ +----+----+ +----+----+ (B) (B) (C) | (C) | +-----------+----------+ | | +-----+------+ +--------+ | Properties | - - - | XMLNSC | +-----+------+ (D) +---+----+ | | +--+--+ | msg | +--+--+ |
The elements in the diagram marked (A), (B) and (C) are created by methods of
the MbMessageCollection class. Other elements, such as the children of the
folder elements and their children in Properties and message body related
children are created via their parent elements using the createAs...()
methods of the MbElement class. See
createElementAsLastChild
as an example. There may be other header elements
at (D) in the diagram.
The elements marked (A) in the above diagram are created by the
MbMessageCollection
constructor.
The elements marked (B) are created using the
createNameValue()
method.
The elements marked (C) are created using the
createFolder()
method.
MbElement
,
"Working with Messages. Appendix A: Message Parsers - element definitions"FINALIZE_NONE, FINALIZE_VALIDATE
Constructor and Description |
---|
MbMessageCollection()
Default constructor for MbMessageCollection
|
Modifier and Type | Method and Description |
---|---|
MbElement |
createFolder(String folderName)
Creates a folder element as the last child of the Collection element of the
message collection.
|
MbElement |
createNameValue(String name,
Object value)
Creates a name-value element as the last child of the Collection element
of the message collection.
|
clearMessage, clearMessage, createDOMDocument, evaluateXPath, evaluateXPath, finalizeMessage, getBuffer, getDOMDocument, getRootElement, isReadOnly, toString
public MbMessageCollection() throws MbException
MbException
public MbElement createFolder(String folderName) throws MbException
folderName
- The name of the folder to be createdMbException
public MbElement createNameValue(String name, Object value) throws MbException
MbElement
createElementAs...()
methods. See
createElementAsLastChild
for details.name
- The name of the element to be created.value
- The value of the element to be created. Restrictions apply to
the type of object that may be supplied, see
createElementAsLastChild
for details.MbException