public class JsonDatasourceAttribute extends java.lang.Object implements Attribute
< subreport>
...
< dataSourceExpression>
< ![CDATA[$P{json_attribute}.subDataSource("path.to.list")]]>
< /dataSourceExpression>
< subreportExpression><![CDATA["subreport_name.jasper"]]>< /subreportExpression>
< /subreport>
The expression given to the subDataSource method must select an array in the JSON structure.
| Constructor and Description |
|---|
JsonDatasourceAttribute() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getValue(Template template,
java.lang.String attributeName,
PObject requestJsonAttributes)
Get the attribute value.
|
java.lang.Class |
getValueType()
Get the class of the value.
|
void |
printClientConfig(org.json.JSONWriter json,
Template template)
Write this attribute out the the json writer so that clients can know what attributes are expected.
|
void |
setConfigName(java.lang.String name)
Set the name of the attribute as set in the configuration file.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
public void printClientConfig(org.json.JSONWriter json,
Template template)
throws org.json.JSONException
AttributeprintClientConfig in interface Attributejson - the json writer to write totemplate - the template that this attribute is part oforg.json.JSONExceptionpublic void setConfigName(java.lang.String name)
AttributesetConfigName in interface Attributename - the name of the attributepublic java.lang.Class getValueType()
AttributegetValueType in interface Attributepublic java.lang.Object getValue(@Nonnull
Template template,
@Nonnull
java.lang.String attributeName,
@Nonnull
PObject requestJsonAttributes)
Attributepublic void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidate in interface ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configuration