Class AbstractChartParam
- java.lang.Object
-
- com.xpn.xwiki.plugin.charts.params.AbstractChartParam
-
- All Implemented Interfaces:
ChartParam
- Direct Known Subclasses:
BooleanChartParam
,ChoiceChartParam
,ColorChartParam
,DoubleChartParam
,FloatChartParam
,FontChartParam
,IntegerChartParam
,ListChartParam
,LocaleChartParam
,MapChartParam
,Point2DChartParam
,RectangleInsetsChartParam
,ShapeChartParam
,StringChartParam
,StrokeChartParam
public abstract class AbstractChartParam extends Object implements ChartParam
-
-
Field Summary
Fields Modifier and Type Field Description static String
LIST_SEPARATOR
static String
MAP_ASSIGNMENT
static String
MAP_SEPARATOR
protected String
name
protected boolean
optional
-
Constructor Summary
Constructors Constructor Description AbstractChartParam(String name)
AbstractChartParam(String name, boolean optional)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Object
convert(String value)
boolean
equals(Object obj)
protected Object
getChoiceArg(Map map, String name, Map choices)
protected double
getDoubleArg(Map map, String name)
protected float
getFloatArg(Map map, String name)
protected int
getIntArg(Map map, String name)
protected List
getListArg(Map map, String name)
String
getName()
protected String
getStringArg(Map map, String name)
protected String
getStringOptionalArg(Map map, String name)
abstract Class
getType()
int
hashCode()
boolean
isOptional()
protected List
parseList(String value)
protected Map
parseMap(String value)
protected Map
parseMap(String value, int expectedTokenCount)
protected float[]
toFloatArray(List list)
protected List
toFloatList(List list)
String
toString()
-
-
-
Field Detail
-
name
protected String name
-
optional
protected boolean optional
-
MAP_SEPARATOR
public static final String MAP_SEPARATOR
- See Also:
- Constant Field Values
-
MAP_ASSIGNMENT
public static final String MAP_ASSIGNMENT
- See Also:
- Constant Field Values
-
LIST_SEPARATOR
public static final String LIST_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceChartParam
-
isOptional
public boolean isOptional()
- Specified by:
isOptional
in interfaceChartParam
-
getType
public abstract Class getType()
- Specified by:
getType
in interfaceChartParam
-
convert
public abstract Object convert(String value) throws ParamException
- Specified by:
convert
in interfaceChartParam
- Throws:
ParamException
-
getStringArg
protected String getStringArg(Map map, String name) throws MissingArgumentException
- Throws:
MissingArgumentException
-
getIntArg
protected int getIntArg(Map map, String name) throws MissingArgumentException, InvalidArgumentException
-
getFloatArg
protected float getFloatArg(Map map, String name) throws MissingArgumentException, InvalidArgumentException
-
getDoubleArg
protected double getDoubleArg(Map map, String name) throws MissingArgumentException, InvalidArgumentException
-
getChoiceArg
protected Object getChoiceArg(Map map, String name, Map choices) throws MissingArgumentException, InvalidArgumentException
-
getListArg
protected List getListArg(Map map, String name) throws MissingArgumentException
- Throws:
MissingArgumentException
-
parseMap
protected Map parseMap(String value) throws InvalidArgumentException
- Throws:
InvalidArgumentException
-
parseMap
protected Map parseMap(String value, int expectedTokenCount) throws InvalidArgumentException
- Throws:
InvalidArgumentException
-
toFloatList
protected List toFloatList(List list) throws InvalidArgumentException
- Throws:
InvalidArgumentException
-
toFloatArray
protected float[] toFloatArray(List list) throws InvalidArgumentException
- Throws:
InvalidArgumentException
-
-