org.apertereports.common.xml.config
Class XmlReportConfigLoader

java.lang.Object
  extended by org.apertereports.common.xml.XmlHelper
      extended by org.apertereports.common.xml.config.XmlReportConfigLoader

public class XmlReportConfigLoader
extends XmlHelper


Constructor Summary
XmlReportConfigLoader()
           
 
Method Summary
static XmlReportConfigLoader getInstance()
           
protected  Class[] getSupportedClasses()
           
 String mapAsXml(Map<String,String> map)
          Converts a map of parameters to a marshaled string containing XML representation of a list of ReportConfigParameter.
 List<ReportConfigParameter> mapToParameterList(Map<String,String> map)
          Converts a map of parameters to a list of ReportConfigParameter.
 Map<String,String> parameterListToMap(List<ReportConfigParameter> params)
          Converts a list of ReportConfigParameter to a map.
 String parametersAsXML(List<ReportConfigParameter> parameters)
          Converts a list of ReportConfigParameter to a single string.
 String reportConfigsAsString(List<ReportConfig> reportConfigs)
          Converts a list of ReportConfig to a single string.
 List<ReportConfig> stringAsReportConfigs(String input)
          Converts a string containing XML to a list of ReportConfig.
 Map<String,String> xmlAsMap(String xml)
          Converts a string containing XML representation of ReportConfigParameter to a map.
 List<ReportConfigParameter> xmlAsParameters(String xml)
          Converts a string containing XML to a list of ReportConfigParameter.
 
Methods inherited from class org.apertereports.common.xml.XmlHelper
marshall, unmarshall, unmarshall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlReportConfigLoader

public XmlReportConfigLoader()
Method Detail

getSupportedClasses

protected Class[] getSupportedClasses()
Specified by:
getSupportedClasses in class XmlHelper

getInstance

public static XmlReportConfigLoader getInstance()

reportConfigsAsString

public String reportConfigsAsString(List<ReportConfig> reportConfigs)
Converts a list of ReportConfig to a single string. Basically reverts the result of stringAsReportConfigs(String).

Parameters:
reportConfigs - A list of ReportConfig
Returns:
The XML representation converted to a string
See Also:
ReportConfig

stringAsReportConfigs

public List<ReportConfig> stringAsReportConfigs(String input)
Converts a string containing XML to a list of ReportConfig. Basically reverts the result of reportConfigsAsString(java.util.List).

Parameters:
input -
Returns:
A list of report configs

parametersAsXML

public String parametersAsXML(List<ReportConfigParameter> parameters)
Converts a list of ReportConfigParameter to a single string. Basically reverts the result of xmlAsParameters(String).

Parameters:
parameters - A list of ReportConfigParameter
Returns:
The XML representation converted to a string
See Also:
ReportConfigParameter

xmlAsParameters

public List<ReportConfigParameter> xmlAsParameters(String xml)
Converts a string containing XML to a list of ReportConfigParameter. Basically reverts the result of parametersAsXML(java.util.List).

Parameters:
xml - A string with XML
Returns:
A list of ReportConfigParameter
See Also:
ReportConfigParameter

xmlAsMap

public Map<String,String> xmlAsMap(String xml)
Converts a string containing XML representation of ReportConfigParameter to a map. The key of the map is the parameter's name. The value is ReportConfigParameter.getValue(). Reverts the result of mapAsXml(java.util.Map).

Parameters:
xml - A string with XML
Returns:
A map of parameters

mapAsXml

public String mapAsXml(Map<String,String> map)
Converts a map of parameters to a marshaled string containing XML representation of a list of ReportConfigParameter. Reverts the result of xmlAsMap(String).

Parameters:
map - A map of parameters
Returns:
A string with XML

mapToParameterList

public List<ReportConfigParameter> mapToParameterList(Map<String,String> map)
Converts a map of parameters to a list of ReportConfigParameter. Reverts the result of parameterListToMap(java.util.List).

Parameters:
map - A map of parameters
Returns:
A list of ReportConfigParameter

parameterListToMap

public Map<String,String> parameterListToMap(List<ReportConfigParameter> params)
Converts a list of ReportConfigParameter to a map. Reverts the result of mapToParameterList(java.util.Map).

Parameters:
params - A list of parameters
Returns:
A map of parameters


Copyright © 2011-2012. All Rights Reserved.