addPropertyMaker("master-reference", m);
// maximum-repeats
- m = new StringProperty.Maker(PR_MAXIMUM_REPEATS);
+ m = new NumberProperty.Maker(PR_MAXIMUM_REPEATS);
m.setInherited(false);
+ m.addEnum("no-limit", makeEnumProperty(NO_LIMIT, "NO_LIMIT"));
m.setDefault("no-limit");
addPropertyMaker("maximum-repeats", m);
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.Property;
/**
* A repeatable-page-master-alternatives formatting object.
+ parent.getName(), locator);
}
- String mr = getProperty(PR_MAXIMUM_REPEATS).getString();
- if (mr.equals("no-limit")) {
+ Property mr = getProperty(PR_MAXIMUM_REPEATS);
+
+ if (mr.getEnum() == NO_LIMIT) {
this.maximumRepeats = INFINITE;
} else {
- try {
- this.maximumRepeats = Integer.parseInt(mr);
- if (this.maximumRepeats < 0) {
- getLogger().debug("negative maximum-repeats: "
- + this.maximumRepeats);
- this.maximumRepeats = 0;
- }
- } catch (NumberFormatException nfe) {
- throw new SAXParseException("Invalid number for "
- + "'maximum-repeats' property", locator);
+ this.maximumRepeats = mr.getNumber().intValue();
+ if (this.maximumRepeats < 0) {
+ getLogger().debug("negative maximum-repeats: "
+ + this.maximumRepeats);
+ this.maximumRepeats = 0;
}
}
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.Property;
/**
* A repeatable-page-master-reference formatting object.
pageSequenceMaster.addSubsequenceSpecifier(this);
}
- String mr = getPropString(PR_MAXIMUM_REPEATS);
+ Property mr = getProperty(PR_MAXIMUM_REPEATS);
- if (mr.equals("no-limit")) {
+ if (mr.getEnum() == NO_LIMIT) {
this.maximumRepeats = INFINITE;
} else {
- try {
- this.maximumRepeats = Integer.parseInt(mr);
- if (this.maximumRepeats < 0) {
- getLogger().debug("negative maximum-repeats: "
- + this.maximumRepeats);
- this.maximumRepeats = 0;
- }
- } catch (NumberFormatException nfe) {
- throw new SAXParseException("Invalid number for "
- + "'maximum-repeats' property", locator);
+ this.maximumRepeats = mr.getNumber().intValue();
+ if (this.maximumRepeats < 0) {
+ getLogger().debug("negative maximum-repeats: "
+ + this.maximumRepeats);
+ this.maximumRepeats = 0;
}
}
}