Tabnine Logo
IEngineConfiguration
Code IndexAdd Tabnine to your IDE (free)

How to use
IEngineConfiguration
in
org.thymeleaf

Best Java code snippets using org.thymeleaf.IEngineConfiguration (Showing top 20 results out of 315)

origin: thymeleaf/thymeleaf

/**
 * <p>
 *   Returns the cache manager in effect. This manager is in charge of providing
 *   the various caches needed by the system during its process.
 * </p>
 * <p>
 *   By default, an instance of {@link org.thymeleaf.cache.StandardCacheManager}
 *   is set.
 * </p>
 *
 * @return the cache manager
 */
public final ICacheManager getCacheManager() {
  if (this.initialized) {
    return this.configuration.getCacheManager();
  }
  return this.cacheManager;
}
origin: thymeleaf/thymeleaf

/**
 * <p>
 *   Obtain the expression parser (implementation of {@link IStandardExpressionParser}) registered by
 *   the Standard Dialect that is being currently used.
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return the parser object.
 */
public static IStandardExpressionParser getExpressionParser(final IEngineConfiguration configuration) {
  final Object parser =
      configuration.getExecutionAttributes().get(STANDARD_EXPRESSION_PARSER_ATTRIBUTE_NAME);
  if (parser == null || (!(parser instanceof IStandardExpressionParser))) {
    throw new TemplateProcessingException(
        "No Standard Expression Parser has been registered as an execution argument. " +
        "This is a requirement for using Standard Expressions, and might happen " +
        "if neither the Standard or the SpringStandard dialects have " +
        "been added to the Template Engine and none of the specified dialects registers an " +
        "attribute of type " + IStandardExpressionParser.class.getName() + " with name " +
        "\"" + STANDARD_EXPRESSION_PARSER_ATTRIBUTE_NAME + "\"");
  }
  return (IStandardExpressionParser) parser;
}
origin: thymeleaf/thymeleaf

@Override
public IExpressionObjects getExpressionObjects() {
  // We delay creation of expression objects in case they are not needed at all
  if (this.expressionObjects == null) {
    this.expressionObjects = new ExpressionObjects(this, this.configuration.getExpressionObjectFactory());
  }
  return this.expressionObjects;
}
origin: thymeleaf/thymeleaf

public StandardModelFactory(final IEngineConfiguration configuration, final TemplateMode templateMode) {
  super();
  Validate.notNull(configuration, "Configuration cannot be null");
  Validate.notNull(configuration.getAttributeDefinitions(), "Attribute Definitions returned by Engine Configuration cannot be null");
  Validate.notNull(configuration.getElementDefinitions(), "Element Definitions returned by Engine Configuration cannot be null");
  Validate.notNull(templateMode, "Template Mode cannot be null");
  this.configuration = configuration;
  this.attributeDefinitions = this.configuration.getAttributeDefinitions();
  this.elementDefinitions = this.configuration.getElementDefinitions();
  this.templateMode = templateMode;
}
origin: thymeleaf/thymeleaf

Validate.notNull(this.configuration.getElementDefinitions(), "Element Definitions returned by the Engine Configuration cannot be null");
Validate.notNull(this.configuration.getAttributeDefinitions(), "Attribute Definitions returned by the Engine Configuration cannot be null");
this.attributeDefinitions = this.configuration.getAttributeDefinitions();
final Set<ITemplateBoundariesProcessor> templateBoundariesProcessorSet = this.configuration.getTemplateBoundariesProcessors(this.templateMode);
final Set<ICDATASectionProcessor> cdataSectionProcessorSet = this.configuration.getCDATASectionProcessors(this.templateMode);
final Set<ICommentProcessor> commentProcessorSet = this.configuration.getCommentProcessors(this.templateMode);
final Set<IDocTypeProcessor> docTypeProcessorSet = this.configuration.getDocTypeProcessors(this.templateMode);
final Set<IProcessingInstructionProcessor> processingInstructionProcessorSet = this.configuration.getProcessingInstructionProcessors(this.templateMode);
final Set<ITextProcessor> textProcessorSet = this.configuration.getTextProcessors(this.templateMode);
final Set<IXMLDeclarationProcessor> xmlDeclarationProcessorSet = this.configuration.getXMLDeclarationProcessors(this.templateMode);
origin: thymeleaf/thymeleaf

final ICacheManager cacheManager = configuration.getCacheManager();
final Set<ITemplateResolver> templateResolvers = configuration.getTemplateResolvers();
final Set<IMessageResolver> messageResolvers = configuration.getMessageResolvers();
final Set<ILinkBuilder> linkBuilders = configuration.getLinkBuilders();
final Set<DialectConfiguration> dialectConfigurations = configuration.getDialectConfigurations();
origin: thymeleaf/thymeleaf

public IModel parse(final TemplateData ownerTemplate, final String template) {
  // We will be setting useCache to false because we don't want to pollute the cache with mere String
  // parsing done from here. Also, we are 'artificially' specifying it as nested even if we don't really
  // know if this fragment is exactly a nested text inside the template, but that's not really important...
  return this.configuration.getTemplateManager().parseString(ownerTemplate, template, 0, 0, this.templateMode, false);
}
origin: thymeleaf/thymeleaf

/**
 * <p>
 *   This constructor should only be called directly for <strong>testing purposes</strong>.
 * </p>
 *
 * @param configuration the engine configuration
 */
public TemplateManager(final IEngineConfiguration configuration) {
  
  super();
  Validate.notNull(configuration, "Configuration cannot be null");
  this.configuration = configuration;
  final ICacheManager cacheManager = this.configuration.getCacheManager();
  if (cacheManager == null) {
    this.templateCache = null;
  } else {
    this.templateCache = cacheManager.getTemplateCache();
  }
  final boolean standardDialectPresent = this.configuration.isStandardDialectPresent();
  // TODO Make these parser implementations configurable: one parser per template mode, then make default implementations extensible/configurable (e.g. AttoParser config)
  this.htmlParser = new HTMLTemplateParser(DEFAULT_PARSER_POOL_SIZE,DEFAULT_PARSER_BLOCK_SIZE);
  this.xmlParser = new XMLTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE);
  this.textParser = new TextTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE, standardDialectPresent);
  this.javascriptParser = new JavaScriptTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE, standardDialectPresent);
  this.cssParser = new CSSTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE, standardDialectPresent);
  this.rawParser = new RawTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE);
}

origin: thymeleaf/thymeleaf

templateName,
templateHandler,
configuration.getElementDefinitions(),
configuration.getAttributeDefinitions(),
templateMode,
lineOffset, colOffset);
configuration,
templateMode,
configuration.getStandardDialectPrefix(),
handler);
origin: thymeleaf/thymeleaf

final Set<IPostProcessor> postProcessors = configuration.getPostProcessors(getTemplateMode());
if (postProcessors.isEmpty()) {
  structureHandler.setBody(unescapedTextStr, false);
    configuration.getTemplateManager().parseString(
        context.getTemplateData(),
        unescapedTextStr,
origin: thymeleaf/thymeleaf

@Override
protected void writeUnresolved(final Writer writer) throws IOException {
  this.context.getConfiguration().getTemplateManager().process(this.templateModel, this.context, writer);
}
origin: thymeleaf/thymeleaf

        templateName,
        templateHandler,
        configuration.getElementDefinitions(),
        configuration.getAttributeDefinitions(),
        templateMode,
        lineOffset, colOffset);
        configuration,
        templateMode,
        configuration.getStandardDialectPrefix(),
        handler);
final String standardDialectPrefix = configuration.getStandardDialectPrefix();
referenceResolver =
    (standardDialectPrefix != null ?
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

/**
 * <p>
 *   Obtain the JavaScript serializer (implementation of {@link IStandardJavaScriptSerializer}) registered by
 *   the Standard Dialect that is being currently used.
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return the parser object.
 */
public static IStandardJavaScriptSerializer getJavaScriptSerializer(final IEngineConfiguration configuration) {
  final Object serializer =
      configuration.getExecutionAttributes().get(STANDARD_JAVASCRIPT_SERIALIZER_ATTRIBUTE_NAME);
  if (serializer == null || (!(serializer instanceof IStandardJavaScriptSerializer))) {
    throw new TemplateProcessingException(
        "No JavaScript Serializer has been registered as an execution argument. " +
        "This is a requirement for using Standard serialization, and might happen " +
        "if neither the Standard or the SpringStandard dialects have " +
        "been added to the Template Engine and none of the specified dialects registers an " +
        "attribute of type " + IStandardJavaScriptSerializer.class.getName() + " with name " +
        "\"" + STANDARD_JAVASCRIPT_SERIALIZER_ATTRIBUTE_NAME + "\"");
  }
  return (IStandardJavaScriptSerializer) serializer;
}
origin: thymeleaf/thymeleaf

@Override
protected String resolveText() {
  final Writer stringWriter = new FastStringWriter();
  this.context.getConfiguration().getTemplateManager().process(this.templateModel, this.context, stringWriter);
  return stringWriter.toString();
}
origin: thymeleaf/thymeleaf

public final IExpressionObjects getExpressionObjects() {
  // We delay creation of expression objects in case they are not needed at all
  if (this.expressionObjects == null) {
    this.expressionObjects = new ExpressionObjects(this, this.configuration.getExpressionObjectFactory());
  }
  return this.expressionObjects;
}
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

/**
 * <p>
 *   Obtain the CSS serializer (implementation of {@link IStandardCSSSerializer}) registered by
 *   the Standard Dialect that is being currently used.
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return the variable expression evaluator object.
 */
public static IStandardCSSSerializer getCSSSerializer(final IEngineConfiguration configuration) {
  final Object serializer =
      configuration.getExecutionAttributes().get(STANDARD_CSS_SERIALIZER_ATTRIBUTE_NAME);
  if (serializer == null || (!(serializer instanceof IStandardCSSSerializer))) {
    throw new TemplateProcessingException(
        "No CSS Serializer has been registered as an execution argument. " +
        "This is a requirement for using Standard serialization, and might happen " +
        "if neither the Standard or the SpringStandard dialects have " +
        "been added to the Template Engine and none of the specified dialects registers an " +
        "attribute of type " + IStandardCSSSerializer.class.getName() + " with name " +
        "\"" + STANDARD_CSS_SERIALIZER_ATTRIBUTE_NAME + "\"");
  }
  return (IStandardCSSSerializer) serializer;
}
origin: thymeleaf/thymeleaf

/**
 * <p>
 *   Completely clears the Template Cache.
 * </p>
 * <p>
 *   If this method is called before the TemplateEngine has been initialized,
 *   it causes its initialization.
 * </p>
 */
public void clearTemplateCache() {
  if (!this.initialized) {
    initialize();
  }
  this.configuration.getTemplateManager().clearCaches();
}
origin: thymeleaf/thymeleaf-spring

@Override
public IExpressionObjects getExpressionObjects() {
  // We delay creation of expression objects in case they are not needed at all
  if (this.expressionObjects == null) {
    this.expressionObjects = new ExpressionObjects(this, this.configuration.getExpressionObjectFactory());
  }
  return this.expressionObjects;
}
org.thymeleafIEngineConfiguration

Javadoc

Interface defining the main configuration object that specifies how an ITemplateEngine instance should behave.

Implementations of this interface should be thread-safe.

Most used methods

  • getCacheManager
  • getExecutionAttributes
  • getExpressionObjectFactory
  • getTemplateManager
  • getAttributeDefinitions
  • getCDATASectionProcessors
  • getCommentProcessors
  • getDecoupledTemplateLogicResolver
  • getDialectConfigurations
  • getDialects
  • getDocTypeProcessors
  • getElementDefinitions
  • getDocTypeProcessors,
  • getElementDefinitions,
  • getEngineContextFactory,
  • getLinkBuilders,
  • getMessageResolvers,
  • getModelFactory,
  • getPostProcessors,
  • getPreProcessors,
  • getProcessingInstructionProcessors,
  • getStandardDialectPrefix

Popular in Java

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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