Package net.sf.jasperreports.json.query
Class JsonQueryExecuterFactory
- java.lang.Object
-
- net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory
-
- net.sf.jasperreports.json.query.JsonQueryExecuterFactory
-
- All Implemented Interfaces:
QueryExecuterFactory
,Designated
- Direct Known Subclasses:
JsonQLQueryExecuterFactory
public class JsonQueryExecuterFactory extends AbstractQueryExecuterFactory implements Designated
JSON query executer factory. The factory createsJsonQueryExecuter
query executers.- Author:
- Narcis Marcu (narcism@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
JSON_DATE_PATTERN
Parameter/property holding the format pattern used to instantiate java.util.Date instances.static String
JSON_INPUT_STREAM
Built-in parameter holding the value of thejava.io.InputStream
to be used for obtaining the JSON data.static String
JSON_LOCALE
Parameter holding the value of the datasource Localestatic String
JSON_LOCALE_CODE
Built-in parameter/property holding thejava.lang.String
code of the locale to be used when parsing the JSON data.static String
JSON_NUMBER_PATTERN
Parameter/property holding the format pattern used to instantiate java.lang.Number instances.static String
JSON_QUERY_EXECUTER_NAME
static String
JSON_SOURCE
Built-in parameter/property holding the value of the source for the JSON file.static String
JSON_SOURCES
static String
JSON_TIME_ZONE
Parameter holding the value of the datasource Timezonestatic String
JSON_TIMEZONE_ID
Built-in parameter/property holding thejava.lang.String
value of the time zone id to be used when parsing the JSON data.-
Fields inherited from interface net.sf.jasperreports.engine.query.QueryExecuterFactory
QUERY_EXECUTER_FACTORY_PREFIX
-
-
Constructor Summary
Constructors Constructor Description JsonQueryExecuterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JRQueryExecuter
createQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, Map<String,? extends JRValueParameter> parameters)
Creates a query executer.JRQueryExecuter
createQueryExecuter(QueryExecutionContext context, JRDataset dataset, Map<String,? extends JRValueParameter> parameters)
Object[]
getBuiltinParameters()
Returns the built-in parameters associated with this query type.String
getDesignation()
boolean
supportsQueryParameterType(String className)
Decides whether the query executers created by this factory support a query parameter type.
-
-
-
Field Detail
-
JSON_QUERY_EXECUTER_NAME
public static final String JSON_QUERY_EXECUTER_NAME
- See Also:
- Constant Field Values
-
JSON_INPUT_STREAM
public static final String JSON_INPUT_STREAM
Built-in parameter holding the value of thejava.io.InputStream
to be used for obtaining the JSON data.- See Also:
- Constant Field Values
-
JSON_SOURCE
public static final String JSON_SOURCE
Built-in parameter/property holding the value of the source for the JSON file. It can be:- a resource on the classpath
- a file from the filesystem, with an absolute or relative path
- a url
- See Also:
- Constant Field Values
-
JSON_SOURCES
public static final String JSON_SOURCES
- See Also:
- Constant Field Values
-
JSON_DATE_PATTERN
public static final String JSON_DATE_PATTERN
Parameter/property holding the format pattern used to instantiate java.util.Date instances.- See Also:
- Constant Field Values
-
JSON_NUMBER_PATTERN
public static final String JSON_NUMBER_PATTERN
Parameter/property holding the format pattern used to instantiate java.lang.Number instances.- See Also:
- Constant Field Values
-
JSON_LOCALE
public static final String JSON_LOCALE
Parameter holding the value of the datasource Locale- See Also:
- Constant Field Values
-
JSON_LOCALE_CODE
public static final String JSON_LOCALE_CODE
Built-in parameter/property holding thejava.lang.String
code of the locale to be used when parsing the JSON data. The allowed format is: language[_country[_variant]]- See Also:
- Constant Field Values
-
JSON_TIME_ZONE
public static final String JSON_TIME_ZONE
Parameter holding the value of the datasource Timezone- See Also:
- Constant Field Values
-
JSON_TIMEZONE_ID
public static final String JSON_TIMEZONE_ID
Built-in parameter/property holding thejava.lang.String
value of the time zone id to be used when parsing the JSON data.- See Also:
- Constant Field Values
-
-
Method Detail
-
getBuiltinParameters
public Object[] getBuiltinParameters()
Description copied from interface:QueryExecuterFactory
Returns the built-in parameters associated with this query type. These parameters will be created as system-defined parameters for each report/dataset having a query of this type. The returned array should contain consecutive pairs of parameter names and parameter classes (e.g.{"Param1", String.class, "Param2", "List.class"}
).- Specified by:
getBuiltinParameters
in interfaceQueryExecuterFactory
- Returns:
- array of built-in parameter names and types associated with this query type
-
createQueryExecuter
public JRQueryExecuter createQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, Map<String,? extends JRValueParameter> parameters) throws JRException
Description copied from interface:QueryExecuterFactory
Creates a query executer. This method is called at fill time for reports/datasets having a query supported by this factory.- Specified by:
createQueryExecuter
in interfaceQueryExecuterFactory
- Parameters:
jasperReportsContext
- the JasperReportsContextdataset
- the dataset containing the query, fields, etcparameters
- map of value parameters (instances ofJRValueParameter
) indexed by name- Returns:
- a query executer
- Throws:
JRException
-
createQueryExecuter
public JRQueryExecuter createQueryExecuter(QueryExecutionContext context, JRDataset dataset, Map<String,? extends JRValueParameter> parameters) throws JRException
- Specified by:
createQueryExecuter
in interfaceQueryExecuterFactory
- Throws:
JRException
-
supportsQueryParameterType
public boolean supportsQueryParameterType(String className)
Description copied from interface:QueryExecuterFactory
Decides whether the query executers created by this factory support a query parameter type. This check is performed for all $P{..} parameters in the query.- Specified by:
supportsQueryParameterType
in interfaceQueryExecuterFactory
- Parameters:
className
- the value class name of the parameter- Returns:
- whether the parameter value type is supported
-
getDesignation
public String getDesignation()
- Specified by:
getDesignation
in interfaceDesignated
-
-