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 of IFunction that allows you to chain function parameters in a javascript safe way.
See Also:
  • Constructor Details

    • AbstractFunction

      protected AbstractFunction(CharSequence functionName)
      Construct.
      Parameters:
      functionName - The function name of this IFunction implementation
    • AbstractFunction

      protected AbstractFunction(CharSequence functionName, List<CharSequence> parameters)
      Construct.
      Parameters:
      functionName - The function name of this IFunction implementation
  • Method Details

    • build

      public String build()
      Specified by:
      build in interface IFunction
      Returns:
      the function as javascript string.
    • 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()