congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ICacheManager.getExpressionCache
Code IndexAdd Tabnine to your IDE (free)

How to use
getExpressionCache
method
in
org.thymeleaf.cache.ICacheManager

Best Java code snippets using org.thymeleaf.cache.ICacheManager.getExpressionCache (Showing top 15 results out of 315)

origin: thymeleaf/thymeleaf

static Object getFromCache(final IEngineConfiguration configuration, final String input, final String type) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      return cache.get(new ExpressionCacheKey(type,input));
    }
  }
  return null;
}
origin: thymeleaf/thymeleaf

static <V> void putIntoCache(final IEngineConfiguration configuration, final String input, final V value, final String type) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      cache.put(new ExpressionCacheKey(type,input), value);
    }
  }
}
origin: thymeleaf/thymeleaf

static <V> void removeFromCache(final IEngineConfiguration configuration, final String input, final String type) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      cache.clearKey(new ExpressionCacheKey(type,input));
    }
  }
}
origin: thymeleaf/thymeleaf

final ICache<ExpressionCacheKey, Object> expressionCache = (cacheManager == null? null : cacheManager.getExpressionCache());
origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.thymeleaf.thymeleaf

private static Object getFromCache(final Configuration configuration, final String input, final String prefix) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<String,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      return cache.get(prefix + input);
    }
  }
  return null;
}
origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.thymeleaf.thymeleaf

private static <V> void putIntoCache(final Configuration configuration, final String input, final V value, final String prefix) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<String,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      cache.put(prefix + input, value);
    }
  }
}

origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.thymeleaf.thymeleaf

public final List<Node> extractFragment(final Configuration configuration, final List<Node> nodes) {
  DOMSelector selector = null;
  ICache<String,Object> expressionCache = null;
  
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    expressionCache = cacheManager.getExpressionCache();
    if (expressionCache != null) {
      selector = (DOMSelector) expressionCache.get(this.domSelectorCacheKey);
    }
  }
  
  if (selector == null) {
    selector = new DOMSelector(this.selectorExpression);
    if (expressionCache != null) {
      expressionCache.put(this.domSelectorCacheKey, selector);
    }
  }
  
  final List<Node> extraction = selector.select(nodes, this.referenceChecker);
  if (extraction == null || extraction.size() == 0) {
    return null;
  }
    
  
  return extraction;
}
origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.thymeleaf.thymeleaf

public final List<Node> extractFragment(final Configuration configuration, final List<Node> nodes) {
  DOMSelector selector = null;
  ICache<String,Object> expressionCache = null;
  
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    expressionCache = cacheManager.getExpressionCache();
    if (expressionCache != null) {
      selector = (DOMSelector) expressionCache.get(this.domSelectorCacheKey);
    }
  }
  
  if (selector == null) {
    selector = new DOMSelector(this.selectorExpression);
    if (expressionCache != null) {
      expressionCache.put(this.domSelectorCacheKey, selector);
    }
  }
  final DOMSelector.INodeReferenceChecker referenceChecker = getReferenceChecker(configuration);
  final List<Node> extraction = selector.select(nodes, referenceChecker);
  if (extraction == null || extraction.size() == 0) {
    return null;
  }
    
  
  return extraction;
}
origin: thymeleaf/thymeleaf-spring

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    final SpelExpression spelExpressionObject = (SpelExpression) PARSER.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: org.thymeleaf/thymeleaf-spring3

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    final SpelExpression spelExpressionObject = (SpelExpression) PARSER.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.thymeleaf.thymeleaf

final ICacheManager cacheManager = configuration.getCacheManager();
if (cacheManager != null) {
  cache = cacheManager.getExpressionCache();
  if (cache != null) {
    expressionTree = cache.get(OGNL_CACHE_PREFIX + expression);
origin: thymeleaf/thymeleaf-spring

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    // SELECT THE ADEQUATE SpEL EXPRESSION PARSER depending on whether SpEL compilation is enabled
    final SpelExpressionParser spelExpressionParser =
        PARSER_WITH_COMPILED_SPEL != null && SpringStandardExpressions.isSpringELCompilerEnabled(configuration)?
            PARSER_WITH_COMPILED_SPEL : PARSER_WITHOUT_COMPILED_SPEL;
    final SpelExpression spelExpressionObject = (SpelExpression) spelExpressionParser.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: thymeleaf/thymeleaf-spring

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    // SELECT THE ADEQUATE SpEL EXPRESSION PARSER depending on whether SpEL compilation is enabled
    final SpelExpressionParser spelExpressionParser =
        PARSER_WITH_COMPILED_SPEL != null && SpringStandardExpressions.isSpringELCompilerEnabled(configuration)?
            PARSER_WITH_COMPILED_SPEL : PARSER_WITHOUT_COMPILED_SPEL;
    final SpelExpression spelExpressionObject = (SpelExpression) spelExpressionParser.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: org.thymeleaf/thymeleaf-spring4

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    // SELECT THE ADEQUATE SpEL EXPRESSION PARSER depending on whether SpEL compilation is enabled
    final SpelExpressionParser spelExpressionParser =
        PARSER_WITH_COMPILED_SPEL != null && SpringStandardExpressions.isSpringELCompilerEnabled(configuration)?
            PARSER_WITH_COMPILED_SPEL : PARSER_WITHOUT_COMPILED_SPEL;
    final SpelExpression spelExpressionObject = (SpelExpression) spelExpressionParser.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: org.wisdom-framework/thymeleaf-template-engine

final ICacheManager cacheManager = configuration.getCacheManager();
if (cacheManager != null) {
  cache = cacheManager.getExpressionCache();
org.thymeleaf.cacheICacheManagergetExpressionCache

Javadoc

Returns the cache of expression evaluation artifacts.

This cache is meant to store artifacts of diverse nature needed along the process of parsing and executing expressions in the several languages available: Standard expressions, OGNL expressions, Spring EL expressions...

Parsing these expressions usually results in some kind of syntax tree object that represents the expression, and this is what this cache usually stores.

Keys are the expressions themselves (their String representation), along with a type that is normally used for identifying the nature of the object being cached (for example {"ognl","person.name"}}).

Popular methods of ICacheManager

  • getTemplateCache
    Returns the cache of parsed templates. Keys are the template names, as specified at the org.thymele
  • clearAllCaches
    Clears all the caches managed by this cache manager instance. This method is mainly intended for
  • getFragmentCache
    Returns the cache of template code fragments. These fragments are pieces of template code that need
  • getMessageCache
    Returns the cache used for externalized/internationalized messages. This cache uses as keys the t

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • Kernel (java.awt.image)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Reference (javax.naming)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now