|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xwiki.rendering.internal.macro.chart.source.AbstractDataSource
public abstract class AbstractDataSource
A data source is able to provide a data set for chart generation. This super class provides basic parameter validation.
Field Summary | |
---|---|
static String |
DATASET_PARAM
The name of the dataset parameter. |
static String |
PLOT_TYPE_PARAM
The name of the plot type parameter. |
Fields inherited from interface org.xwiki.rendering.internal.macro.chart.source.DataSource |
---|
PARAMS_PARAM, SOURCE_PARAM |
Constructor Summary | |
---|---|
AbstractDataSource()
|
Method Summary | |
---|---|
ChartModel |
getChartModel()
DataSource.buildDataset(java.lang.String, java.util.Map must be called before this method. |
DatasetType |
getDatasetType()
|
protected LocaleConfiguration |
getLocaleConfiguration()
|
protected void |
invalidParameterValue(String parameterName,
String value)
Indicate that an invalid parameter value was found. |
protected void |
setAxes()
Set the axes from the axis configuration. |
protected void |
setChartModel(SimpleChartModel chartModel)
Set the chart model. |
protected void |
setDataset(Dataset dataset)
|
void |
setDatasetType(DatasetType datasetType)
|
protected abstract boolean |
setParameter(String key,
String value)
Let an implementation set a parameter. |
protected void |
validateDatasetType()
Validate the dataset parameter. |
protected abstract void |
validateParameters()
Let an implementation validate the value of the previously set parameters, and set default values. |
protected void |
validateParameters(Map<String,String> parameters)
Validate and set parameters for the data source. |
protected void |
validatePlotType()
Validate the plot type parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xwiki.rendering.internal.macro.chart.source.DataSource |
---|
buildDataset |
Field Detail |
---|
public static final String DATASET_PARAM
public static final String PLOT_TYPE_PARAM
Constructor Detail |
---|
public AbstractDataSource()
Method Detail |
---|
protected void validateParameters(Map<String,String> parameters) throws MacroExecutionException
parameters
- The parameters.
MacroExecutionException
- if the parameters are invalid for this data source.protected abstract boolean setParameter(String key, String value) throws MacroExecutionException
key
- The key of the parameter.value
- The value of the parameter.
true
if the parameter was claimed.
MacroExecutionException
- if the parameter is invalid in some way.protected abstract void validateParameters() throws MacroExecutionException
MacroExecutionException
- if the previously set value is invalid.protected void validateDatasetType() throws MacroExecutionException
MacroExecutionException
- if the previously set value is invalid.protected void validatePlotType() throws MacroExecutionException
MacroExecutionException
- if the previously set value is invalid.protected void setAxes() throws MacroExecutionException
MacroExecutionException
- if the axes are incorrectly specified.public DatasetType getDatasetType()
public void setDatasetType(DatasetType datasetType)
datasetType
- the dataset type to configure.public ChartModel getChartModel()
DataSource
DataSource.buildDataset(java.lang.String, java.util.Map, org.xwiki.rendering.transformation.MacroTransformationContext)
must be called before this method.
getChartModel
in interface DataSource
ChartModel
for the dataset.protected void setChartModel(SimpleChartModel chartModel)
chartModel
- The chart model.protected void setDataset(Dataset dataset)
dataset
- the dataset.protected void invalidParameterValue(String parameterName, String value) throws MacroExecutionException
parameterName
- The name of the parameter.value
- The value.
MacroExecutionException
- always.protected LocaleConfiguration getLocaleConfiguration()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |