diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-12-17 11:09:11 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-12-17 11:09:11 +0100 |
commit | 591c7ec8451ea28dafec03b5d37276b943e444da (patch) | |
tree | 53520218a829e5ed147b560e7673f28883de0686 /pdf-as-lib/src/main/java/at/gv/egiz | |
parent | c1af1550afe468537f480b399896d477f950c7d1 (diff) | |
download | pdf-as-4-591c7ec8451ea28dafec03b5d37276b943e444da.tar.gz pdf-as-4-591c7ec8451ea28dafec03b5d37276b943e444da.tar.bz2 pdf-as-4-591c7ec8451ea28dafec03b5d37276b943e444da.zip |
Fix Value resolver bug for SIG_DATE
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz')
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java | 22 |
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; } |