aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/api/sign
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/api/sign')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java87
1 files changed, 86 insertions, 1 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 7dd2f6d..fc4ebaf 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
@@ -16,6 +16,27 @@ import at.gv.egiz.pdfas.api.timestamp.TimeStamper;
*/
public class SignParameters
{
+// 23.11.2010 changed by exthex - added parameters for placeholder handling
+ /**
+ * Strict matching mode for placeholder extraction.<br/>
+ * If the placeholder with the given id is not found in the document, an exception will be thrown.
+ */
+ public static final int PLACEHOLDER_MATCH_MODE_STRICT = 0;
+
+ /**
+ * A moderate matching mode for placeholder extraction.<br/>
+ * If the placeholder with the given id is not found in the document, the first placeholder without an id will be taken.<br/>
+ * If there is no such placeholder, the signature will be placed as usual, according to the pos parameter of the signature profile used.
+ */
+ public static final int PLACEHOLDER_MATCH_MODE_MODERATE = 1;
+
+ /**
+ * A more lenient matching mode for placeholder extraction.<br/>
+ * If the placeholder with the given id is not found in the document, the first found placeholder will be taken, regardless if it has an id set, or not.<br/>
+ * If there is no placeholder at all, the signature will be placed as usual, according to the pos parameter of the signature profile used.
+ */
+ public static final int PLACEHOLDER_MATCH_MODE_LENIENT = 2;
+
/**
* The document to be signed.
*
@@ -99,8 +120,26 @@ public class SignParameters
protected DataSink output = null;
protected TimeStamper timeStamperImpl;
+
+ /**
+ *
+ */
+ protected boolean checkForPlaceholder;
+
+ /**
+ * The id of the placeholder which should be replaced.
+ */
+ protected String placeholderId;
+
+ /**
+ * The matching mode for placeholder extraction.<br/>
+ * If a {@link SignParameters#placeholderId} is set, the match mode determines what is to be done, if no matching placeholder is found in the document.
+ * <br/>
+ * Defaults to {@link SignParameters#PLACEHOLDER_MATCH_MODE_MODERATE}.
+ */
+ protected int placeholderMatchMode = PLACEHOLDER_MATCH_MODE_MODERATE;
-
+
/**
* {@link #setTimeStamperImpl(TimeStamper)}
* @return
@@ -236,5 +275,51 @@ public class SignParameters
this.signatureKeyIdentifier = signatureKeyIdentifier;
}
+ /**
+ *
+ * @return
+ */
+ public boolean isCheckForPlaceholder() {
+ return this.checkForPlaceholder;
+ }
+
+ /**
+ *
+ * @param check
+ */
+ public void setCheckForPlaceholder(boolean check) {
+ this.checkForPlaceholder = check;
+ }
+
+ /**
+ *
+ * @param placeholderId
+ */
+ public void setPlaceholderId(String placeholderId) {
+ this.placeholderId = placeholderId;
+ }
+
+ /**
+ *
+ * @return the placeholderId
+ */
+ public String getPlaceholderId() {
+ return placeholderId;
+ }
+
+ /**
+ *
+ * @param placeholderMatchMode
+ */
+ public void setPlaceholderMatchMode(int placeholderMatchMode) {
+ this.placeholderMatchMode = placeholderMatchMode;
+ }
+ /**
+ *
+ * @return the placeholderMatchMode
+ */
+ public int getPlaceholderMatchMode() {
+ return this.placeholderMatchMode;
+ }
}