|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.codestreet.messageforge.Converter
com.codestreet.messageforge.ConverterXML
Converter class for XML. This class provides the methods for marshalling a RMapMessage to XML and for unmarshalling XML to RMapMessage
| Constructor Summary | |
ConverterXML()
|
|
| Method Summary | |
static void |
closeStartTag(java.io.Writer writer,
boolean newLines)
Write the close of an open tag to the specified writer. |
static void |
closeTag(java.io.Writer writer,
boolean newLines)
Write the close of an open tag to the specified writer. |
static void |
closeTag(java.io.Writer writer,
java.lang.String tag,
int indentLevel,
java.lang.String indent,
boolean newLines)
Close the close of an open tag to the specified writer. |
static java.lang.String |
getEncoding()
Gets the output encoding. |
static void |
main(java.lang.String[] args)
|
static int |
marshal(boolean skipJMSSupported,
boolean skipDeclaration,
int indentLevel,
java.lang.String xmlTag,
RMapMessage source,
java.io.Writer target)
Convert a message object to XML and write to specified target writer. |
static java.lang.String |
marshal(boolean skipJMSSupported,
RMapMessage source)
Convert a message object to XML. |
static java.lang.String |
marshal(RMapMessage source)
Convert a message object to XML. |
static void |
marshal(RMapMessage source,
java.io.File target)
Convert a message object to XML and write to specified File. |
static void |
marshal(RMapMessage source,
java.io.OutputStream target)
Convert a message object to XML and write to specified OutputStream. |
static void |
marshal(RMapMessage source,
java.io.Writer target)
Convert a message object to XML and write to specified target writer. |
static void |
openTag(java.io.Writer writer,
java.lang.String tag,
int indentLevel,
java.lang.String indent)
Write an open tag to the specified writer. |
static void |
setEncoding(java.lang.String encoding)
Sets the output encoding. |
static void |
setExpandEmptyElements(boolean expandEmptyElements)
This will set whether empty elements are expanded from |
static void |
setIndent(java.lang.String indent)
This will set the indent String to use; this is usually a String of empty spaces. |
static void |
setNewlines(boolean newLines)
This will set whether newlines are printed with the generated XML. |
static void |
setOmitDeclaration(boolean omitDeclaration)
This will set whether the XML declaration ( ) is written with the XML. |
static void |
setOmitEncoding(boolean omitEncoding)
This will set whether the XML declaration ( ) includes the encoding of the document. |
static void |
setXmlValidation(boolean validate,
java.lang.String[] schemas)
This will set whether XML validation occurs when parsing. |
static RMapMessage |
unmarshal(org.jdom.Element root)
Create a message object from specified Element. |
static RMapMessage |
unmarshal(java.io.File source)
Create a message object from specified File. |
static RMapMessage |
unmarshal(java.io.InputStream source)
Create a message object from specified InputStream. |
static RMapMessage |
unmarshal(java.io.Reader source)
Create a message object from specified Reader. |
static RMapMessage |
unmarshal(java.lang.String source)
Create a message object from XML. |
static RMapMessage |
unmarshal(java.lang.String source,
RMapMessage target)
Create a message object from specified Element. |
static RMapMessage |
unmarshal(java.net.URL source)
Create a message object from specified URL. |
static void |
writeAttribute(java.io.Writer writer,
java.lang.String name,
java.lang.String val)
Write an attribute to the specified writer. |
static void |
writeAttribute(java.io.Writer writer,
java.lang.String name0,
java.lang.String value0,
java.lang.String name1,
java.lang.String value1)
Write up to three attributes to the specified writer. |
static void |
writeDeclaration(java.io.Writer writer)
Write the XML version/encoding to specified writer. |
| Methods inherited from class com.codestreet.messageforge.Converter |
createMsgObject, createMsgObject, dateToDouble, dateToLong, dateToStr, getBeanValidator, getLenient, getVersion, setBeanValidator, setDateFromDouble, setDateFromLong, setDateFromStr, setDefaultFactory, setMaximumFractionDigits |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConverterXML()
| Method Detail |
public static void setXmlValidation(boolean validate,
java.lang.String[] schemas)
throws ConverterException
validate - true if validation will occur, otherwise
false.schemas - Set of XML schemas to use for validation. Each schema must be
specified as an URL. For example,
http://www.w3.org/2001/12/soap-envelope soap-envelope.xsd.
ConverterExceptionpublic static void setExpandEmptyElements(boolean expandEmptyElements)
expandEmptyElements - boolean indicating whether or not empty elements should be
expanded.public static void setIndent(java.lang.String indent)
indent - String to use for indentation.public static void setEncoding(java.lang.String encoding)
encoding - the encoding format. Use XML-style names like UTF-8 or
ISO-8859-1 or US-ASCIIpublic static java.lang.String getEncoding()
setEncoding(String)public static void setOmitDeclaration(boolean omitDeclaration)
omitDeclaration - Flag indicating whether or not the XML declaration should be
written.public static void setOmitEncoding(boolean omitEncoding)
omitEncoding - Flag indicating whether or not the XML declaration should
indicate the document encoding.public static void setNewlines(boolean newLines)
newLines - true indicates new lines should be printed, else
new lines are ignored (compacted).
public static java.lang.String marshal(RMapMessage source)
throws ConverterException
source - Message object.
ConverterException
public static java.lang.String marshal(boolean skipJMSSupported,
RMapMessage source)
throws ConverterException
skipJMSSupported - If true then fields that are natively supported by
JMS MapMessage are not marshalled.source - Message object.
ConverterException
public static void marshal(RMapMessage source,
java.io.File target)
throws ConverterException
source - Message object.target - Target output file.
ConverterException
public static void marshal(RMapMessage source,
java.io.OutputStream target)
throws ConverterException
source - Message object.target - Target output stream.
ConverterException
public static void marshal(RMapMessage source,
java.io.Writer target)
throws ConverterException
source - Message object.target - Target writer.
ConverterException
public static int marshal(boolean skipJMSSupported,
boolean skipDeclaration,
int indentLevel,
java.lang.String xmlTag,
RMapMessage source,
java.io.Writer target)
throws ConverterException
skipJMSSupported - If true then fields that are natively supported by
JMS MapMessage are skipped.skipDeclaration - If true then the XML declaration is not written.indentLevel - Indentation level.xmlTag - XML tag for the top level element.source - Message object.target - Target writer.
ConverterException
public static RMapMessage unmarshal(java.lang.String source)
throws ConverterException
source - Source XML.
ConverterException
public static RMapMessage unmarshal(java.io.Reader source)
throws ConverterException
source - Source Reader.
ConverterException
public static RMapMessage unmarshal(java.io.InputStream source)
throws ConverterException
source - Source InputStream.
ConverterException
public static RMapMessage unmarshal(java.io.File source)
throws ConverterException
source - Source File.
ConverterException
public static RMapMessage unmarshal(java.net.URL source)
throws ConverterException
source - Source URL.
ConverterException
public static RMapMessage unmarshal(org.jdom.Element root)
throws ConverterException
root - Source Element.
ConverterException
public static RMapMessage unmarshal(java.lang.String source,
RMapMessage target)
throws ConverterException
source - Source XML.target - Target message object.
ConverterException
public static final void openTag(java.io.Writer writer,
java.lang.String tag,
int indentLevel,
java.lang.String indent)
throws java.io.IOException
writer - Writer.tag - Tag.indentLevel - Indentation level.indent - Indentation.
java.io.IOException
public static final void closeTag(java.io.Writer writer,
boolean newLines)
throws java.io.IOException
writer - Writer.newLines - A newline is written if true.
java.io.IOException
public static final void closeTag(java.io.Writer writer,
java.lang.String tag,
int indentLevel,
java.lang.String indent,
boolean newLines)
throws java.io.IOException
writer - Writer.tag - Tag.indentLevel - Indentation level.indent - Indentation.
java.io.IOException
public static final void closeStartTag(java.io.Writer writer,
boolean newLines)
throws java.io.IOException
writer - Writer.newLines - A newline is written if true.
java.io.IOException
public static final void writeAttribute(java.io.Writer writer,
java.lang.String name0,
java.lang.String value0,
java.lang.String name1,
java.lang.String value1)
throws java.io.IOException
writer - Writer.name0 - First attribute name.value0 - First attribute value.name1 - Second attribute name.value1 - Second attribute value.
java.io.IOException
public static final void writeAttribute(java.io.Writer writer,
java.lang.String name,
java.lang.String val)
throws java.io.IOException
writer - Writer.name - Attribute name.val - Attribute value.
java.io.IOExceptionpublic static void main(java.lang.String[] args)
public static final void writeDeclaration(java.io.Writer writer)
throws java.io.IOException
writer - Writer.
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||