15
15
* limitations under the License.
18
/* $Id: FunctionBase.java 679326 2008-07-24 09:35:34Z vhennebert $ */
18
/* $Id: FunctionBase.java 1328964 2012-04-22 20:09:49Z gadams $ */
20
20
package org.apache.fop.fo.expr;
22
22
import org.apache.fop.datatypes.PercentBase;
23
import org.apache.fop.fo.properties.Property;
24
import org.apache.fop.fo.properties.StringProperty;
25
27
* Abstract Base class for XSL-FO functions
27
29
public abstract class FunctionBase implements Function {
30
* @return null (by default, functions have no percent-based arguments)
32
public int getOptionalArgsCount() {
37
public Property getOptionalArgDefault(int index, PropertyInfo pi) throws PropertyException {
38
if ( index >= getOptionalArgsCount() ) {
39
PropertyException e = new PropertyException ( new IndexOutOfBoundsException ( "illegal optional argument index" ) );
40
e.setPropertyInfo ( pi );
48
public boolean hasVariableArgs() {
32
53
public PercentBase getPercentBase() {
37
* @return false (by default don't pad arglist with property-name)
58
* @param pi property information instance that applies to property being evaluated
59
* @return string property whose value is name of property being evaluated
39
public boolean padArgsWithPropertyName() {
61
protected final Property getPropertyName ( PropertyInfo pi ) {
62
return StringProperty.getInstance ( pi.getPropertyMaker().getName() );