aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/expr/FromParentFunction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/fo/expr/FromParentFunction.java')
-rw-r--r--src/java/org/apache/fop/fo/expr/FromParentFunction.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/java/org/apache/fop/fo/expr/FromParentFunction.java b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
index b1e9d689d..e24074e9d 100644
--- a/src/java/org/apache/fop/fo/expr/FromParentFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
@@ -29,29 +29,29 @@ import org.apache.fop.fo.properties.Property;
*/
public class FromParentFunction extends FunctionBase {
- /**
- * @return 1 (maximum arguments for the from-parent function)
- */
- public int nbArgs() {
+ /** {@inheritDoc} */
+ public int getRequiredArgsCount() {
+ return 0;
+ }
+
+ @Override
+ /** {@inheritDoc} */
+ public int getOptionalArgsCount() {
return 1;
}
- /**
- * @return true (allow padding of arglist with property name)
- */
- public boolean padArgsWithPropertyName() {
- return true;
+ @Override
+ /** {@inheritDoc} */
+ public Property getOptionalArgDefault(int index, PropertyInfo pi) throws PropertyException {
+ if ( index == 0 ) {
+ return getPropertyName ( pi );
+ } else {
+ return super.getOptionalArgDefault ( index, pi );
+ }
}
- /**
- * @param args array of arguments, which should either be empty, or the
- * first of which should contain an NCName corresponding to property name
- * @param pInfo PropertyInfo object to be evaluated
- * @return property containing the computed value
- * @throws PropertyException if the arguments are incorrect
- */
- public Property eval(Property[] args,
- PropertyInfo pInfo) throws PropertyException {
+ /** {@inheritDoc} */
+ public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException {
String propName = args[0].getString();
if (propName == null) {
throw new PropertyException("Incorrect parameter to from-parent function");