Revision: 12986
http://sourceforge.net/p/foray/code/12986
Author: victormote
Date: 2022-12-31 13:44:11 +0000 (Sat, 31 Dec 2022)
Log Message:
-----------
Move common code related to canEvalKeyword and evalKeyword to default implementation in the interface.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCountry.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtInteger.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtKeep.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLanguage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthBpIpDirection.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthConditional.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthRange.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtNumber.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtPercentage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtScript.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtShadowEffect.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtString.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTextDeco.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtUri.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Expr.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprAdditiveOper.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprMultiplicativeOper.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprUnaryOper.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNumber.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnProportionalColumnWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValueStatic.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ValueCollection.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -170,14 +170,4 @@
return true;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderWidth.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderWidth.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -180,14 +180,4 @@
return false;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -52,14 +52,4 @@
return this.value;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -765,14 +765,4 @@
return (float) integralColor / divisor;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCountry.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCountry.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCountry.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -96,14 +96,4 @@
return dtCountry;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -121,14 +121,4 @@
}
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtInteger.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtInteger.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtInteger.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -97,14 +97,4 @@
return this.getValue();
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtKeep.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtKeep.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtKeep.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -159,14 +159,4 @@
return DtKeep.DEFAULT_KEEP_VALUE;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLanguage.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLanguage.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLanguage.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -72,16 +72,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public String toString() {
return this.getValue();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -230,14 +230,4 @@
return this.units == DtLength.UNIT_EMS;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthBpIpDirection.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthBpIpDirection.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthBpIpDirection.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -104,14 +104,4 @@
return this.ipdLength;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthConditional.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthConditional.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthConditional.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -69,14 +69,4 @@
return this.conditionality;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthRange.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthRange.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthRange.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -171,14 +171,4 @@
return false;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtName.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtName.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtName.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -85,14 +85,4 @@
return dtColor.evalColor();
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtNumber.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtNumber.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtNumber.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -83,14 +83,4 @@
return new DtNumber(aNumber);
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtPercentage.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtPercentage.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtPercentage.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -94,16 +94,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public boolean canEvalPercentage() {
return true;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -217,16 +217,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public Shape computeShape(final Shape inputShape, final int pointSize) {
/* TODO: Not sure what the percent base should be here. It is probably
* relative to the inputShape. */
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtScript.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtScript.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtScript.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -182,14 +182,4 @@
return false;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtShadowEffect.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtShadowEffect.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtShadowEffect.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -191,14 +191,4 @@
return this.color.getValue();
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -314,14 +314,4 @@
}
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtString.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtString.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtString.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -52,14 +52,4 @@
return this.value;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTextDeco.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTextDeco.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTextDeco.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -126,14 +126,4 @@
this.isUnderlined = isUnderlined;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -113,14 +113,4 @@
return new DtTime(quantity, units);
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtUri.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtUri.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtUri.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -109,14 +109,4 @@
return tokenizedList;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtWritingMode.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -555,16 +555,6 @@
return null;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
/**
* Indicates whether this writing-mode is horizontal or vertical.
* @return True if this writing-mode is horizontal, false if it is vertical.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Expr.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Expr.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Expr.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -34,19 +34,16 @@
*/
public abstract class Expr implements PropertyValue {
- /** Constant indicating an invalid unit power, that is, a non-numeric
- * item.*/
+ /** Constant indicating an invalid unit power, that is, a non-numeric item.*/
public static final byte UNIT_POWER_NON_NUMERIC = -1;
/** Constant indicating a numeric item, but one that has zero dimensions. */
public static final byte UNIT_POWER_NUMERIC = 0;
- /** Constant indicating a one-dimensional item in space, that is, a
- * length. */
+ /** Constant indicating a one-dimensional item in space, that is, a length. */
public static final byte UNIT_POWER_LENGTH = 1;
- /** Constant indicating a two-dimensional item in space, that is, an
- * area. */
+ /** Constant indicating a two-dimensional item in space, that is, an area. */
public static final byte UNIT_POWER_AREA = 2;
/** Constant indicating an add operation. */
@@ -67,14 +64,4 @@
/** Constant indicating a negation operation. */
public static final byte OPERATION_NEGATION = '-';
- /**
- * Standard exception when trying to evaluate to a Keyword for a value that
- * cannot do so.
- * @return An appropriate Exception.
- */
- public IllegalStateException evalKeywordException() {
- return new IllegalStateException("Property cannot evaluate to a "
- + "Keyword.");
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprAdditiveOper.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprAdditiveOper.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprAdditiveOper.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -170,16 +170,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public boolean canEvalPercentage() {
return this.operand1.canEvalPercentage()
&& this.operand2.canEvalPercentage();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprMultiplicativeOper.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprMultiplicativeOper.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprMultiplicativeOper.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -222,16 +222,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public boolean canEvalPercentage() {
return this.operand1.canEvalPercentage()
&& this.operand2.canEvalPercentage();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprUnaryOper.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprUnaryOper.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ExprUnaryOper.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -101,16 +101,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public boolean canEvalPercentage() {
return this.operand1.canEvalPercentage();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractColor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractColor.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractColor.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -39,14 +39,4 @@
return true;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -104,14 +104,4 @@
return super.evalInteger();
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNumber.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNumber.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNumber.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -39,14 +39,4 @@
return true;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -84,16 +84,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public boolean isValidForObject(final FoObj fobj) {
final ListItem listItem = fobj.getNearestListItem(null);
if (listItem == null) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -88,16 +88,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public boolean isValidForObject(final FoObj fobj) {
final ListItem listItem = fobj.getNearestListItem(null);
if (listItem == null) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnProportionalColumnWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnProportionalColumnWidth.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnProportionalColumnWidth.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -99,16 +99,6 @@
}
@Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
- @Override
public boolean isValidForObject(final FoObj fobj) {
/* Per the XSL-FO standard 1.0, Section 5.10.4, it is an error for
* this function to be used by anything but a table-column. */
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -125,14 +125,4 @@
return this.propertyType;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -210,14 +210,4 @@
return null;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValue.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValue.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValue.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -170,17 +170,19 @@
* Indicates whether this property value can evaluate to a keyword.
* @return True if and only if this property value can evaluate to a keyword.
*/
- boolean canEvalKeyword();
+ default boolean canEvalKeyword() {
+ return false;
+ }
/**
* Returns the keyword value of this property value.
- * This method should only be executed on instances where
- * {@link #canEvalKeyword()} returns true.
- * Doing so on other instances may result in an
- * {@link IllegalStateException}.
* @return The keyword value of this property value.
+ * @throws IllegalStateException If this value cannot be expressed as a keyword.
+ * Test with {@link #canEvalKeyword()} to avoid this exception.
*/
- PvKeyword evalKeyword();
+ default PvKeyword evalKeyword() {
+ throw new IllegalStateException("Property cannot evaluate to a keyword.");
+ }
/**
* Indicates whether this function can be evaluated in the context of a given object.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValueStatic.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValueStatic.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyValueStatic.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -34,14 +34,4 @@
*/
public abstract class PropertyValueStatic implements PropertyValue {
- /**
- * Standard exception when trying to evaluate to a Keyword for a value that
- * cannot do so.
- * @return An appropriate Exception.
- */
- public IllegalStateException evalKeywordException() {
- return new IllegalStateException("Property cannot evaluate to a "
- + "Keyword.");
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ValueCollection.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ValueCollection.java 2022-12-31 12:42:50 UTC (rev 12985)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/ValueCollection.java 2022-12-31 13:44:11 UTC (rev 12986)
@@ -107,14 +107,4 @@
return returnArray;
}
- @Override
- public boolean canEvalKeyword() {
- return false;
- }
-
- @Override
- public PvKeyword evalKeyword() {
- throw this.evalKeywordException();
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|