com.sage.accpac.sm.crystal.ufl
Class AbstractAccpacFormulaFunction

java.lang.Object
  extended by com.sage.accpac.sm.crystal.ufl.AbstractAccpacFormulaFunction
All Implemented Interfaces:
com.crystaldecisions.reports.formulas.FormulaFunction, com.crystaldecisions.reports.formulas.FormulaFunctionDefinition
Direct Known Subclasses:
IsTrue, PrintNonNull, PwFormatDate, PwFormatString, PwFormatTime, RemoveLeadZero, SpellMoney

public abstract class AbstractAccpacFormulaFunction
extends java.lang.Object
implements com.crystaldecisions.reports.formulas.FormulaFunction

Base class for a Crystal UFL formula function that belongs to the Java version of the Accpac UFL library. The library is a combination of functions based on the UFLCAPW (u2lcapw.dll) and UFLCHKS (u2lchks.dll) C UFLs.


Constructor Summary
AbstractAccpacFormulaFunction()
           
 
Method Summary
protected  int getIntegerArgument(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments, int i)
           Returns the specified Crystal formula argument as an integer (primitive int type).
protected  java.lang.String getStringArgument(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments, int i, boolean allowNull)
           Returns the specified Crystal formula argument as a string.
 void validateArgumentValues(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.crystaldecisions.reports.formulas.FormulaFunction
evaluate
 
Methods inherited from interface com.crystaldecisions.reports.formulas.FormulaFunctionDefinition
getArguments, getIdentifier, getReturnType
 

Constructor Detail

AbstractAccpacFormulaFunction

public AbstractAccpacFormulaFunction()
Method Detail

validateArgumentValues

public void validateArgumentValues(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments)
                            throws com.crystaldecisions.reports.formulas.FormulaFunctionCallException

Specified by:
validateArgumentValues in interface com.crystaldecisions.reports.formulas.FormulaFunction
Throws:
com.crystaldecisions.reports.formulas.FormulaFunctionCallException

getStringArgument

protected java.lang.String getStringArgument(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments,
                                             int i,
                                             boolean allowNull)
                                      throws com.crystaldecisions.reports.formulas.FormulaFunctionCallException

Returns the specified Crystal formula argument as a string. Also does validation that the index exists, that the argument is of the correct type, and if a null value isn't allowed, validates that the argument's value is non-null.

NOTE: This method assumes that it is called during the execution of evaluate. At this point, validateArgumentValues(FormulaValueReference[]) should have already been called, so it has already checked that the number of arguments is correct (and thus has checked that the arguments parameter is non-null).

Parameters:
arguments - The non-null array of argument values.
i - The 0-based index of the argument in question.
allowNull - Whether or not a null argument value is valid. (Note that an empty string is NOT null.)
Returns:
The argument in question, as a string.
Throws:
com.crystaldecisions.reports.formulas.FormulaFunctionCallException - The function call failed due to invalid external input.

getIntegerArgument

protected int getIntegerArgument(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments,
                                 int i)
                          throws com.crystaldecisions.reports.formulas.FormulaFunctionCallException

Returns the specified Crystal formula argument as an integer (primitive int type). Also does validation that the index exists, that the argument is of the correct type, and if a null value isn't allowed, validates that the argument's value is non-null.

NOTE: This method assumes that it is called during the execution of evaluate. At this point, validateArgumentValues(FormulaValueReference[]) should have already been called, so it has already checked that the number of arguments is correct (and thus has checked that the arguments parameter is non-null).

Parameters:
arguments - The non-null array of argument values.
i - The 0-based index of the argument in question.
Returns:
The argument in question, as an integer.
Throws:
com.crystaldecisions.reports.formulas.FormulaFunctionCallException - The function call failed due to invalid external input.


Copyright © 2011 Sage Software, Inc. All rights reserved.