Revision: 7862
http://svn.sourceforge.net/foray/?rev=7862&view=rev
Author: victormote
Date: 2006-09-02 16:49:50 -0700 (Sat, 02 Sep 2006)
Log Message:
-----------
Move some property validation from startup() to validateProperties().
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/StaticContent.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -54,7 +54,10 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
+ final String name = traitFlowName();
+ if (name == null || name.equals("")) {
+ throwException(getFullName() + "requires a 'flow-name'.");
+ }
}
/**
@@ -64,16 +67,6 @@
return;
}
- /**
- * {@inheritDoc}
- */
- protected void setup() throws FOTreeException {
- final String name = traitFlowName();
- if (name == null || name.equals("")) {
- throwException(getFullName() + "requires a 'flow-name'.");
- }
- }
-
public boolean isRAGenerator() {
return true;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -62,25 +62,25 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
+ /* Validate properties. */
+ if (traitMasterReference() == null) {
+ logWarning(getFullName() + " has no master-reference, and "
+ + "will be ignored.");
+ }
}
/**
* {@inheritDoc}
*/
- protected void validateDescendants() throws FOTreeException {
+ public void setup() {
return;
}
/**
* {@inheritDoc}
*/
- public void setup() {
- /* Validate properties. */
- if (traitMasterReference() == null) {
- logWarning(getFullName() + " has no master-reference, and "
- + "will be ignored.");
- }
+ protected void validateDescendants() throws FOTreeException {
+ return;
}
public String getName() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -57,20 +57,6 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void validateDescendants() throws FOTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setup() throws FOTreeException {
/* Using a null context here is OK, because we are not computing
* a length to be used anywhere, only testing the relative values of
* the min, max, and optimum. */
@@ -88,6 +74,20 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
+ public void setup() throws FOTreeException {
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void validateDescendants() throws FOTreeException {
+ return;
+ }
+
public String getName() {
return "leader";
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -73,20 +73,6 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void validateDescendants() throws FOTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setup() throws FOTreeException {
// Make sure that no sibling marker has the same 'marker-class-name'.
final List siblings = realParent().getChildren();
for (int i = 0; i < siblings.size(); i++) {
@@ -110,6 +96,20 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
+ public void setup() throws FOTreeException {
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void validateDescendants() throws FOTreeException {
+ return;
+ }
+
public String getName() {
return "marker";
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -97,7 +97,6 @@
* {@inheritDoc}
*/
public void setup() throws FOTreeException {
- // get the 'format' properties
this.pageNumberGenerator = new PageNumberGenerator(this.traitFormat(),
this.traitGroupingSeparator(), this.traitGroupingSize(), this
.traitLetterValue());
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -68,30 +68,28 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
+ final String masterName = this.traitMasterName();
+ if (masterName == null) {
+ logWarning(getFullName() + " has no page-master-name, and will be "
+ + "ignored.");
+ } else {
+ this.layoutMasterSet().addPageSequenceMaster(masterName, this);
+ }
}
/**
* {@inheritDoc}
*/
- protected void validateDescendants() throws FOTreeException {
- return;
+ public void setup() throws FOTreeException {
+ currentSubSequenceNumber = -1;
+ currentSubSequence = null;
}
/**
* {@inheritDoc}
*/
- public void setup() throws FOTreeException {
- currentSubSequenceNumber = -1;
- currentSubSequence = null;
- /* Validate properties. */
- final String masterName = this.traitMasterName();
- if (masterName == null) {
- logWarning(getFullName() + " has no page-master-name, and will be "
- + "ignored.");
- } else {
- this.layoutMasterSet().addPageSequenceMaster(masterName, this);
- }
+ protected void validateDescendants() throws FOTreeException {
+ return;
}
public void end() throws FOTreeException {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -55,26 +55,26 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
+ if (traitRegionName() == null
+ || traitRegionName().equals("")) {
+ throwException("region-name may not be null.");
+ }
+ validateReservedNames();
+ validateConsistentClassUsage();
}
/**
* {@inheritDoc}
*/
- protected void validateDescendants() throws FOTreeException {
+ public void setup() throws FOTreeException {
return;
}
/**
* {@inheritDoc}
*/
- public void setup() throws FOTreeException {
- if (traitRegionName() == null
- || traitRegionName().equals("")) {
- throwException("region-name may not be null.");
- }
- validateReservedNames();
- validateConsistentClassUsage();
+ protected void validateDescendants() throws FOTreeException {
+ return;
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -65,27 +65,26 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
+ final String masterReference = traitMasterReference();
+ if (masterReference == null
+ || masterReference.equals("")) {
+ logWarning(getFullName() + " has no master-reference, and will be "
+ + "ignored.");
+ }
}
/**
* {@inheritDoc}
*/
- protected void validateDescendants() throws FOTreeException {
+ public void setup() {
return;
}
/**
* {@inheritDoc}
*/
- public void setup() {
- /* Validate properites. */
- final String masterReference = traitMasterReference();
- if (masterReference == null
- || masterReference.equals("")) {
- logWarning(getFullName() + " has no master-reference, and will be "
- + "ignored.");
- }
+ protected void validateDescendants() throws FOTreeException {
+ return;
}
public String getName() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/StaticContent.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/StaticContent.java 2006-09-02 23:40:57 UTC (rev 7861)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/StaticContent.java 2006-09-02 23:49:50 UTC (rev 7862)
@@ -46,7 +46,6 @@
* {@inheritDoc}
*/
public void setup() throws FOTreeException {
- super.setup();
getPageSequence().addStaticContent(this);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|