Class FunctionBase

java.lang.Object
org.apache.fop.fo.expr.FunctionBase
All Implemented Interfaces:
Function
Direct Known Subclasses:
AbsFunction, BodyStartFunction, FromNearestSpecifiedValueFunction, FromParentFunction, FromTableColumnFunction, InheritedPropFunction, LabelEndFunction, MaxFunction, MinFunction, OCAColorFunction, ProportionalColumnWidthFunction

public abstract class FunctionBase extends Object implements Function
Abstract Base class for XSL-FO functions
  • Constructor Details

    • FunctionBase

      public FunctionBase()
  • Method Details

    • getOptionalArgsCount

      public int getOptionalArgsCount()
      Specified by:
      getOptionalArgsCount in interface Function
      Returns:
      the number of non-required (optional) arguments that may be specified in the argument list, which, if specified, must follow the required arguments
    • getOptionalArgDefault

      public Property getOptionalArgDefault(int index, PropertyInfo pi) throws PropertyException
      Specified by:
      getOptionalArgDefault in interface Function
      Parameters:
      index - of optional argument
      pi - property information instance that applies to property being evaluated
      Returns:
      the default property value for the optional argument at INDEX, where INDEX is with respect to optional arguments; i.e., the first optional argument position is index 0; if no default for a given index, then null is returned
      Throws:
      PropertyException - if index is greater than or equal to optional args count
    • hasVariableArgs

      public boolean hasVariableArgs()
      Determine if function allows variable arguments. If it does, then they must appear after required and optional arguments, and all optional arguments must be specified.
      Specified by:
      hasVariableArgs in interface Function
      Returns:
      true if function permits additional variable number of arguments after required and (completely specified) optional arguments
    • getPercentBase

      public PercentBase getPercentBase()
      Specified by:
      getPercentBase in interface Function
      Returns:
      the basis for percentage calculations
    • getPropertyName

      protected final Property getPropertyName(PropertyInfo pi)
      Parameters:
      pi - property information instance that applies to property being evaluated
      Returns:
      string property whose value is name of property being evaluated