org.apache.fop.fo.expr

## 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 java.lang.Object
      implements Function

  Abstract Base class for XSL-FO functions

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionBase()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Property` | `getOptionalArgDefault(int index, PropertyInfo pi)`
    `int` | `getOptionalArgsCount()`
    `PercentBase` | `getPercentBase()`
    `protected Property` | `getPropertyName(PropertyInfo pi)`
    `boolean` | `hasVariableArgs()` Determine if function allows variable arguments.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.fop.fo.expr.Function

      `eval, getRequiredArgsCount`

- - ### Constructor Detail

    - #### FunctionBase

          public FunctionBase()

  - ### Method Detail

    - #### 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

Copyright 1999-2015 The Apache Software Foundation. All Rights Reserved.