From 8f5122514624dfea879e243f3bfa9e9875b3be6c Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Sat, 24 Aug 2013 23:09:32 +0200 Subject: [PATCH] added ability to clear template and expression caches in jade configuration --- src/main/java/de/neuland/jade4j/JadeConfiguration.java | 4 ++++ .../java/de/neuland/jade4j/expression/ExpressionHandler.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/de/neuland/jade4j/JadeConfiguration.java b/src/main/java/de/neuland/jade4j/JadeConfiguration.java index 73c45dda..6c55d9b9 100644 --- a/src/main/java/de/neuland/jade4j/JadeConfiguration.java +++ b/src/main/java/de/neuland/jade4j/JadeConfiguration.java @@ -150,4 +150,8 @@ public void setCaching(boolean cache) { } } + public void clearCache() { + ExpressionHandler.clearCache(); + cache.clear(); + } } diff --git a/src/main/java/de/neuland/jade4j/expression/ExpressionHandler.java b/src/main/java/de/neuland/jade4j/expression/ExpressionHandler.java index 5b428951..552faf0f 100644 --- a/src/main/java/de/neuland/jade4j/expression/ExpressionHandler.java +++ b/src/main/java/de/neuland/jade4j/expression/ExpressionHandler.java @@ -40,4 +40,8 @@ public static String evaluateStringExpression(String expression, JadeModel model public static void setCache(boolean cache) { jexl.setCache(cache ? MAX_ENTRIES : 0); } + + public static void clearCache() { + jexl.clearCache(); + } }