[FOray-commit] SF.net SVN: foray:[12963] trunk/foray/foray-fotree/src
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-12-27 22:06:52
|
Revision: 12963
http://sourceforge.net/p/foray/code/12963
Author: victormote
Date: 2022-12-27 22:06:49 +0000 (Tue, 27 Dec 2022)
Log Message:
-----------
Make FnFromTableColumn extend FnAbstractNamedProperty.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromTableColumn.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/FnFromTableColumnTests.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromTableColumn.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromTableColumn.java 2022-12-27 21:32:26 UTC (rev 12962)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromTableColumn.java 2022-12-27 22:06:49 UTC (rev 12963)
@@ -29,14 +29,13 @@
package org.foray.fotree.value;
import org.foray.fotree.PropertyException;
+import org.foray.fotree.PropertyId;
-import java.awt.Color;
-
/**
* The "from-table-column" function in XSL-FO.
* @see "XSL-FO Recommendation 1.1, Section 5.10.4."
*/
-public class FnFromTableColumn extends Function {
+public class FnFromTableColumn extends FnAbstractNamedProperty {
/** The parameter to this function. */
private DtName operand1;
@@ -44,10 +43,11 @@
/**
* Constructor.
* @param arguments The arguments to this function.
+ * @param propertyType The property which is calling this function.
* @throws PropertyException For errors creating this function.
*/
- public FnFromTableColumn(final Expr[] arguments) throws PropertyException {
- super();
+ public FnFromTableColumn(final Expr[] arguments, final PropertyId propertyType) throws PropertyException {
+ super(arguments, propertyType);
this.operand1 = validateNoneOrOneName(arguments);
}
@@ -64,74 +64,4 @@
return this.operand1;
}
- @Override
- public boolean canEvalNumeric() {
- return false;
- }
-
- @Override
- public double evalNumeric() {
- throw this.evalNumericException();
- }
-
- @Override
- public boolean canEvalLength() {
- return false;
- }
-
- @Override
- public byte getUnitPower() {
- throw this.evalNumericException();
- }
-
- @Override
- public int evalLength(final int pointSize) {
- throw this.evalLengthException();
- }
-
- @Override
- public boolean canEvalColor() {
- return false;
- }
-
- @Override
- public Color evalColor() {
- throw evalColorException();
- }
-
- @Override
- public boolean lengthRequiresFontSize() {
- return false;
- }
-
- @Override
- public boolean canEvalInteger() {
- return false;
- }
-
- @Override
- public int evalInteger() {
- throw evalIntegerException();
- }
-
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
- public boolean canEvalPercentage() {
- return false;
- }
-
- @Override
- public float evalPercentage() {
- throw evalPercentageException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java 2022-12-27 21:32:26 UTC (rev 12962)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java 2022-12-27 22:06:49 UTC (rev 12963)
@@ -44,8 +44,7 @@
* @param propertyType The property which is calling this function.
* @throws PropertyException For errors creating this function.
*/
- public FnMergePropertyValues(final Expr[] arguments,
- final PropertyId propertyType) throws PropertyException {
+ public FnMergePropertyValues(final Expr[] arguments, final PropertyId propertyType) throws PropertyException {
super(arguments, propertyType);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java 2022-12-27 21:32:26 UTC (rev 12962)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Function.java 2022-12-27 22:06:49 UTC (rev 12963)
@@ -84,7 +84,7 @@
return new FnFromParent(arguments, propertyType);
}
case "from-table-column": {
- return new FnFromTableColumn(arguments);
+ return new FnFromTableColumn(arguments, propertyType);
}
case "inherited-property-value": {
return new FnInheritedPropertyValue(arguments, propertyType);
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/FnFromTableColumnTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/FnFromTableColumnTests.java 2022-12-27 21:32:26 UTC (rev 12962)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/value/FnFromTableColumnTests.java 2022-12-27 22:06:49 UTC (rev 12963)
@@ -38,6 +38,14 @@
*/
public class FnFromTableColumnTests {
+ /** Constant used for testing. */
+ private static final DtName NAME_1 = new DtName("orphans");
+
+ /** Constant used for testing. */
+ private static final Expr[] OPERAND_ARRAY_1 = new Expr[] {
+ FnFromTableColumnTests.NAME_1,
+ };
+
/**
* Unit test of a function creation.
* @throws PropertyException For errors during function creation.
@@ -44,7 +52,7 @@
*/
@Test
public void testBasic() throws PropertyException {
- final Function fn = Function.makeFunction("from-table-column", null, null);
+ final Function fn = Function.makeFunction("from-table-column", OPERAND_ARRAY_1, null);
assertTrue(fn instanceof FnFromTableColumn);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|