|
ColdBox Platform - MockBox Version 1.3 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
mockbox.system.core.conversion.XMLConverter
public class XMLConverter
A utility tool that can marshall data to XML
| Constructor Summary | |
|---|---|
init()
|
|
| Method Summary | |
|---|---|
string |
arrayToXML(array data, [boolean useCDATA='false'], string rootName='')
Converts an array into XML with no headers |
private Util |
getUtil()
Create and return a util object |
string |
objectToXML(any data, [boolean useCDATA='false'], string rootName='')
Converts an object(entity) into XML by inspecting its properties and then calling the appropriate getters on it |
string |
queryToXML(query data, [string CDATAColumns=''], [string columnlist='[runtime expression]'], [boolean useCDATA='false'], string rootName='')
Converts a query to XML with no headers |
private string |
safeText(string txt, [boolean useCDATA='false'])
Create a safe xml text |
string |
structToXML(any data, [boolean useCDATA='false'], string rootName='')
Converts a struct into XML with no headers |
string |
toXML(any data, [string columnlist], [boolean useCDATA='false'], [boolean addHeader='true'], string encoding='UTF-8', [string delimiter=','], string rootName='')
Convert any type of data to XML |
private any |
translateValue(struct args, any targetValue)
Translate a value into XML |
private string |
unicodeWin1252(string value)
Converts MS-Windows superset characters (Windows-1252) into their XML friendly unicode counterparts |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init()
| Method Detail |
|---|
public string arrayToXML(array data, [boolean useCDATA='false'], string rootName='')
data - The array to convertuseCDATA - Use CDATA content for ALL values. False by defaultrootName - The name of the root element, else it defaults to the internal defaults.private Util getUtil()
public string objectToXML(any data, [boolean useCDATA='false'], string rootName='')
data - The structure, object, any to convert.useCDATA - Use CDATA content for ALL valuesrootName - The name of the root element, else it defaults to the internal defaults.public string queryToXML(query data, [string CDATAColumns=''], [string columnlist='[runtime expression]'], [boolean useCDATA='false'], string rootName='')
data - The query to convertCDATAColumns - Which columns to wrap in cdata tagscolumnlist - Choose which columns to include in the translation, by default it uses all the columns in the queryuseCDATA - Use CDATA content for ALL valuesrootName - The name of the root element, else it defaults to the internal defaults.private string safeText(string txt, [boolean useCDATA='false'])
txtuseCDATA - Use CDATA content for ALL valuespublic string structToXML(any data, [boolean useCDATA='false'], string rootName='')
data - The structure, object, any to convert.useCDATA - Use CDATA content for ALL valuesrootName - The name of the root element, else it defaults to the internal defaults.public string toXML(any data, [string columnlist], [boolean useCDATA='false'], [boolean addHeader='true'], string encoding='UTF-8', [string delimiter=','], string rootName='')
data - The data to convert to xmlcolumnlist - Choose which columns to inspect, by default it uses all the columns in the query, if using a queryuseCDATA - Use CDATA content for ALL values. The default is falseaddHeader - Add an xml header to the packet returned.encoding - The character encoding of the header. UTF-8 is the defaultdelimiter - The delimiter in the list. Comma by defaultrootName - The name of the root element, else it defaults to the internal defaults.private any translateValue(struct args, any targetValue)
args - The original argument collectiontargetValue - The value to translateprivate string unicodeWin1252(string value)
value
|
ColdBox Platform - MockBox Version 1.3 | ||||
| FRAMES | |||||