aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;
}
+
}