public class MxReadImpl extends java.lang.Object implements MxRead
MxRead
interface to parse XML strings into Mx message objects.
The implementation is not a straight forward jaxb unmarsahlling. Some remarks:
This is the default implementation used for the direct parse calls in MX messages.
Constructor and Description |
---|
MxReadImpl() |
Modifier and Type | Method and Description |
---|---|
static AbstractMX |
parse(java.lang.Class<? extends AbstractMX> targetClass,
java.lang.String xml,
java.lang.Class<?>[] classes)
Static parse implementation of
MxRead.read(Class, String, Class[]) |
static AbstractMX |
parse(java.lang.Class<? extends AbstractMX> targetClass,
java.lang.String xml,
java.lang.Class<?>[] classes,
MxReadParams params) |
static AbstractMX |
parse(java.lang.String xml,
MxId id)
Static parse implementation of
MxRead.read(String, MxId) |
static AbstractMX |
parse(java.lang.String xml,
MxId id,
MxReadParams params) |
AbstractMX |
read(java.lang.Class<? extends AbstractMX> targetClass,
java.lang.String xml,
java.lang.Class<?>[] classes)
Read
xml into a message object |
AbstractMX |
read(java.lang.String xml,
MxId id)
Parses the XML string content into a specific instance of Mx.
|
public static AbstractMX parse(java.lang.Class<? extends AbstractMX> targetClass, java.lang.String xml, java.lang.Class<?>[] classes)
MxRead.read(Class, String, Class[])
xml
- the XML to parse, should contain the Document, and optional AppHdr and any type of wrapper elementspublic static AbstractMX parse(java.lang.Class<? extends AbstractMX> targetClass, java.lang.String xml, java.lang.Class<?>[] classes, MxReadParams params)
public static AbstractMX parse(java.lang.String xml, MxId id)
MxRead.read(String, MxId)
java.lang.IllegalArgumentException
- if the XML parameter is blankjava.lang.NullPointerException
- if the XML parameter is nullpublic static AbstractMX parse(java.lang.String xml, MxId id, MxReadParams params)
public AbstractMX read(java.lang.Class<? extends AbstractMX> targetClass, java.lang.String xml, java.lang.Class<?>[] classes)
MxRead
xml
into a message objectpublic AbstractMX read(java.lang.String xml, MxId id)
If the string is empty, does not contain any MX message, the message type cannot be detected or an error occur reading and parsing the message content; this method returns null.
The implementation detects the message type and uses reflection to call the parser in the specific Mx subclass.
If header is present, it is also parsed into the message object.
read
in interface MxRead
xml
- a string containing an MX message in XML formatid
- optional parameter to indicate the specific MX type to create; autodetected from namespace if null.