public class XML extends Base
Modifier and Type | Method and Description |
---|---|
static void | recordToXML(java.lang.String tagName, java.util.Map record, DataSource ds, java.io.Writer out) Takes a Map and serializes it into XML based on the declarations in the DataSource similar to the client-side API Datasource.xmlSerialize(). |
static void | recordToXML(java.lang.String tagName, java.util.Map record, java.io.Writer out) Takes a Map and serializes it into XML. |
static void | recordToXML(java.lang.String tagName, java.util.Map record, java.io.Writer out, boolean useAttributes, DSRequest dsRequest) Takes a Map and serializes it into XML based on the declarations in the DataSource similar to the client-side API Datasource.xmlSerialize(). |
static void | recordToXML(java.lang.String tagName, java.util.Map record, java.io.Writer out, DSRequest dsRequest) Takes a Map and serializes it into XML. |
static ValidationContext | toJS(org.w3c.dom.Element element, java.io.Writer out) Converts XML from the passed Element object to JavaScript and writes it to the supplied Writer. |
static ValidationContext | toJS(java.io.Reader reader, java.util.Locale locale, java.io.Writer out) Converts XML read from the provided Reader to JavaScript and writes it to the supplied Writer. |
static ValidationContext | toJS(java.lang.String xml, java.util.Locale locale, java.io.Writer out) Converts an XML string to JavaScript, using the passed-in Locale to resolve any <fmt:message> i18n tags, and writes it to the supplied Writer. |
static ValidationContext | toJS(java.lang.String xml, java.io.Writer out) Converts an XML string to JavaScript and writes it to the supplied Writer. |
public static ValidationContext toJS(java.lang.String xml, java.io.Writer out) throws java.lang.Exception
XML.toJS(String) and XML.toJS(Reader) use the XML->JS translation supported by JSTranslater.toJS(), including translation of XML to live SmartClient components. These are convenience methods that assume the inbound String or Reader contains XML.
xml
- xml stringout
- writer where the generated JS output should be writtenjava.lang.Exception
JSTranslater.toJS(Object, Writer)
public static ValidationContext toJS(java.lang.String xml, java.util.Locale locale, java.io.Writer out) throws java.lang.Exception
<fmt:message>
i18n tags, and writes it to the supplied Writer. XML.toJS(String) and XML.toJS(Reader) use the XML->JS translation supported by JSTranslater.toJS(), including translation of XML to live SmartClient components. These are convenience methods that assume the inbound String or Reader contains XML.
xml
- xml stringlocale
- Locale object to use for resolving i18n tags in the supplied XMLout
- writer where the generated JS output should be writtenjava.lang.Exception
JSTranslater.toJS(Object, Writer)
public static ValidationContext toJS(java.io.Reader reader, java.util.Locale locale, java.io.Writer out) throws java.lang.Exception
reader
- reader containing xmllocale
- Locale to use when resolving any i18n tags in the supplied XMLout
- writer where the generated JS output should be writtenjava.lang.Exception
public static ValidationContext toJS(org.w3c.dom.Element element, java.io.Writer out) throws java.lang.Exception
element
- xml element to be convertedout
- writer where the generated JS output should be writtenjava.lang.Exception
public static void recordToXML(java.lang.String tagName, java.util.Map record, java.io.Writer out) throws java.lang.Exception
tagName
- The XML tag to generaterecord
- The Map to render as XMLout
- Writer to output the XML tojava.lang.Exception
public static void recordToXML(java.lang.String tagName, java.util.Map record, java.io.Writer out, DSRequest dsRequest) throws java.lang.Exception
tagName
- The XML tag to generaterecord
- The Map to render as XMLout
- Writer to output the XML todsRequest
- A DSRequest to use as context for the serialization. Pass as null if not appropriatejava.lang.Exception
public static void recordToXML(java.lang.String tagName, java.util.Map record, DataSource ds, java.io.Writer out) throws java.lang.Exception
tagName
- The XML tag to generaterecord
- The Map to render as XMLds
- DataSource to use as template for the serialization.out
- Writer to output the XML tojava.lang.Exception
public static void recordToXML(java.lang.String tagName, java.util.Map record, java.io.Writer out, boolean useAttributes, DSRequest dsRequest) throws java.lang.Exception
tagName
- The XML tag to generaterecord
- The Map to render as XMLout
- Writer to output the XML touseAttributes
- If true, output name/value pairs as XML attributes. XML elements otherwise.dsRequest
- A DSRequest to use as context for the serialization, if appropriate. Null values are permitted.java.lang.Exception