aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-29 14:19:08 +0000
committerpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-29 14:19:08 +0000
commitd5c7f5c7e68c789e8a6a51a51963e6ce16298706 (patch)
tree71e00d60ca01f0768e339402ee1630a5118a9f8b /src/main
parentb88f9c59491c19f6a47aa4cfac48d43b1da5d8c6 (diff)
downloadpdf-as-3-d5c7f5c7e68c789e8a6a51a51963e6ce16298706.tar.gz
pdf-as-3-d5c7f5c7e68c789e8a6a51a51963e6ce16298706.tar.bz2
pdf-as-3-d5c7f5c7e68c789e8a6a51a51963e6ce16298706.zip
added override properties
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@619 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java b/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
index fc4ebaf..bb0e7ad 100644
--- a/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
+++ b/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
@@ -3,11 +3,14 @@
*/
package at.gv.egiz.pdfas.api.sign;
+import java.util.Properties;
+
import at.gv.egiz.pdfas.api.commons.Constants;
import at.gv.egiz.pdfas.api.io.DataSink;
import at.gv.egiz.pdfas.api.io.DataSource;
import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning;
import at.gv.egiz.pdfas.api.timestamp.TimeStamper;
+import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
/**
* Parameter object that holds the sign parameters.
@@ -139,6 +142,11 @@ public class SignParameters
*/
protected int placeholderMatchMode = PLACEHOLDER_MATCH_MODE_MODERATE;
+ protected Properties overrideProps = new Properties();
+
+
+
+
/**
* {@link #setTimeStamperImpl(TimeStamper)}
@@ -276,6 +284,30 @@ public class SignParameters
}
/**
+ * Override user defined values from the used signature profile like "value.SIG_META".
+ * You cannot override pre defined values like SIG_VALUE, SIG_DATE {@link SignatureTypes#REQUIRED_SIG_KEYS}.
+ * The override values are bound to the {@link SignParameters} instance.
+ * @param key the name of the setting to override e.g. "SIG_META"
+ * @param value The new value
+ */
+ public void setProfileOverrideValue(String key, String value) {
+ if (SignatureTypes.isRequredSigTypeKey(key)) {
+ throw new RuntimeException("cannot set value for pre defined signature field names");
+ }
+ this.overrideProps.put(key, value);
+ }
+
+ /**
+ * Get override values created via {@link #setProfileOverrideValue(String, String)}
+ * @return
+ */
+ public Properties getProfileOverrideProperties() {
+ return this.overrideProps;
+
+ }
+
+
+ /**
*
* @return
*/
@@ -322,4 +354,5 @@ public class SignParameters
public int getPlaceholderMatchMode() {
return this.placeholderMatchMode;
}
+
}