aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-lib/src/main')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java
index 38fead85..88051cf0 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java
@@ -25,7 +25,7 @@ public class ValueResolver implements IProfileConstants, IResolver {
public static final String PatternRegex = "\\$(\\{[^\\$]*\\})";
- private static final String defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
+ public static final String defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
public static final String EXP_START = "${";
public static final String EXP_END = "}";
@@ -36,6 +36,16 @@ public class ValueResolver implements IProfileConstants, IResolver {
logger.debug("Resolving value for key: " + key);
logger.debug("Resolving value with value: " + value);
+ if (key.equals(SIG_DATE)) {
+ if (value == null) {
+ value = defaultDateFormat;
+ }
+ // Value holds the date format!
+ SimpleDateFormat formater = new SimpleDateFormat(value);
+ Calendar cal = Calendar.getInstance();
+ return formater.format(cal.getTime());
+ }
+
if (value != null) {
Pattern pattern = Pattern.compile(PatternRegex);
@@ -59,16 +69,6 @@ public class ValueResolver implements IProfileConstants, IResolver {
return result;
}
- if (key.equals(SIG_DATE)) {
- if (value == null) {
- value = defaultDateFormat;
- }
- // Value holds the date format!
- SimpleDateFormat formater = new SimpleDateFormat(value);
- Calendar cal = Calendar.getInstance();
- return formater.format(cal.getTime());
- }
-
return value;
}