Class AbstractFunction
- java.lang.Object
-
- de.agilecoders.wicket.jquery.function.AbstractFunction
-
- All Implemented Interfaces:
IFunction,Serializable,IClusterable
- Direct Known Subclasses:
Function,JavaScriptInlineFunction,OnJqueryFunction,SimpleFunction
public abstract class AbstractFunction extends Object implements IFunction
A simple implementation ofIFunctionthat allows you to chain function parameters in a javascript safe way.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFunction(CharSequence functionName)Construct.protectedAbstractFunction(CharSequence functionName, List<CharSequence> parameters)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddParameter(CharSequence parameter)adds a new parameter to parameter listStringbuild()protected StringbuildParameters()List<CharSequence>getParameters()protected chargetSeparator()protected CharSequencetoParameterValue(JavaScriptInlineFunction value)transform given value to a javascript parameter valueprotected CharSequencetoParameterValue(Boolean value)transform given value to a javascript parameter valueprotected CharSequencetoParameterValue(Float value)transform given value to a javascript parameter valueprotected CharSequencetoParameterValue(Integer value)transform given value to a javascript parameter valueprotected CharSequencetoParameterValue(Long value)transform given value to a javascript parameter valueprotected CharSequencetoParameterValue(Object value)transform given value to a javascript parameter value
-
-
-
Constructor Detail
-
AbstractFunction
protected AbstractFunction(CharSequence functionName)
Construct.- Parameters:
functionName- The function name of thisIFunctionimplementation
-
AbstractFunction
protected AbstractFunction(CharSequence functionName, List<CharSequence> parameters)
Construct.- Parameters:
functionName- The function name of thisIFunctionimplementation
-
-
Method Detail
-
build
public String build()
-
getSeparator
protected final char getSeparator()
- Returns:
- the separator
-
buildParameters
protected String buildParameters()
- Returns:
- a joined list of parameters as string
-
addParameter
protected void addParameter(CharSequence parameter)
adds a new parameter to parameter list- Parameters:
parameter- The parameter to add
-
toParameterValue
protected CharSequence toParameterValue(Object value)
transform given value to a javascript parameter value- Parameters:
value- The value to transform- Returns:
- value as string
-
toParameterValue
protected CharSequence toParameterValue(JavaScriptInlineFunction value)
transform given value to a javascript parameter value- Parameters:
value- The value to transform- Returns:
- value as string
-
toParameterValue
protected CharSequence toParameterValue(Long value)
transform given value to a javascript parameter value- Parameters:
value- The value to transform- Returns:
- value as string
-
toParameterValue
protected CharSequence toParameterValue(Integer value)
transform given value to a javascript parameter value- Parameters:
value- The value to transform- Returns:
- value as string
-
toParameterValue
protected CharSequence toParameterValue(Float value)
transform given value to a javascript parameter value- Parameters:
value- The value to transform- Returns:
- value as string
-
toParameterValue
protected CharSequence toParameterValue(Boolean value)
transform given value to a javascript parameter value- Parameters:
value- The value to transform- Returns:
- value as string
-
getParameters
public List<CharSequence> getParameters()
-
-