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

How to use
getExecutionAttributes
method
in
org.thymeleaf.IEngineConfiguration

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

origin: thymeleaf/thymeleaf

/**
 * <p>
 *   Obtain the conversion service (implementation of {@link IStandardConversionService}) registered by
 *   the Standard Dialect that is being currently used.
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return the conversion service object.
 */
public static IStandardConversionService getConversionService(final IEngineConfiguration configuration) {
  final Object conversionService =
      configuration.getExecutionAttributes().get(STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME);
  if (conversionService == null || (!(conversionService instanceof IStandardConversionService))) {
    throw new TemplateProcessingException(
        "No Standard Conversion Service 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 " + IStandardConversionService.class.getName() + " with name " +
        "\"" + STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME + "\"");
  }
  return (IStandardConversionService) conversionService;
}
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>
 *   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

/**
 * <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

/**
 * <p>
 *   Obtain the variable expression evaluator (implementation of {@link IStandardVariableExpressionEvaluator})
 *   registered by the Standard Dialect that is being currently used.
 * </p>
 * <p>
 *   Normally, there should be no need to obtain this object from the developers' code (only internally from
 *   {@link IStandardExpression} implementations).
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return the variable expression evaluator object.
 */
public static IStandardVariableExpressionEvaluator getVariableExpressionEvaluator(final IEngineConfiguration configuration) {
  final Object expressionEvaluator =
      configuration.getExecutionAttributes().get(STANDARD_VARIABLE_EXPRESSION_EVALUATOR_ATTRIBUTE_NAME);
  if (expressionEvaluator == null || (!(expressionEvaluator instanceof IStandardVariableExpressionEvaluator))) {
    throw new TemplateProcessingException(
        "No Standard Variable Expression Evaluator 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 " + IStandardVariableExpressionEvaluator.class.getName() + " with name " +
        "\"" + STANDARD_VARIABLE_EXPRESSION_EVALUATOR_ATTRIBUTE_NAME + "\"");
  }
  return (IStandardVariableExpressionEvaluator) expressionEvaluator;
}
origin: thymeleaf/thymeleaf-spring

/**
 * <p>
 *   Check whether compilation of Spring EL expressions should be enabled or not.
 * </p>
 * <p>
 *   This is done through configuration methods at the {@link org.thymeleaf.spring4.dialect.SpringStandardDialect}
 *   instance being used, and its value is offered to the engine as an <em>execution attribute</em>.
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return {@code true} if the SpEL compiler should be enabled if available, {@code false} if not.
 */
public static boolean isSpringELCompilerEnabled(final IEngineConfiguration configuration) {
  final Object enableSpringELCompiler =
      configuration.getExecutionAttributes().get(ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME);
  if (enableSpringELCompiler == null) {
    return false;
  }
  if (!(enableSpringELCompiler instanceof Boolean)) {
    throw new TemplateProcessingException(
        "A value for the \"" + ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME + "\" execution attribute " +
        "has been specified, but it is not of the required type Boolean. " +
        "(" + enableSpringELCompiler.getClass().getName() + ")");
  }
  return ((Boolean) enableSpringELCompiler).booleanValue();
}
origin: thymeleaf/thymeleaf-spring

/**
 * <p>
 *   Check whether compilation of Spring EL expressions should be enabled or not.
 * </p>
 * <p>
 *   This is done through configuration methods at the {@link SpringStandardDialect}
 *   instance being used, and its value is offered to the engine as an <em>execution attribute</em>.
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return {@code true} if the SpEL compiler should be enabled if available, {@code false} if not.
 */
public static boolean isSpringELCompilerEnabled(final IEngineConfiguration configuration) {
  final Object enableSpringELCompiler =
      configuration.getExecutionAttributes().get(ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME);
  if (enableSpringELCompiler == null) {
    return false;
  }
  if (!(enableSpringELCompiler instanceof Boolean)) {
    throw new TemplateProcessingException(
        "A value for the \"" + ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME + "\" execution attribute " +
        "has been specified, but it is not of the required type Boolean. " +
        "(" + enableSpringELCompiler.getClass().getName() + ")");
  }
  return ((Boolean) enableSpringELCompiler).booleanValue();
}
origin: org.thymeleaf/thymeleaf-spring4

/**
 * <p>
 *   Check whether compilation of Spring EL expressions should be enabled or not.
 * </p>
 * <p>
 *   This is done through configuration methods at the {@link org.thymeleaf.spring4.dialect.SpringStandardDialect}
 *   instance being used, and its value is offered to the engine as an <em>execution attribute</em>.
 * </p>
 *
 * @param configuration the configuration object for the current template execution environment.
 * @return {@code true} if the SpEL compiler should be enabled if available, {@code false} if not.
 */
public static boolean isSpringELCompilerEnabled(final IEngineConfiguration configuration) {
  final Object enableSpringELCompiler =
      configuration.getExecutionAttributes().get(ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME);
  if (enableSpringELCompiler == null) {
    return false;
  }
  if (!(enableSpringELCompiler instanceof Boolean)) {
    throw new TemplateProcessingException(
        "A value for the \"" + ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME + "\" execution attribute " +
        "has been specified, but it is not of the required type Boolean. " +
        "(" + enableSpringELCompiler.getClass().getName() + ")");
  }
  return ((Boolean) enableSpringELCompiler).booleanValue();
}
origin: thymeleaf/thymeleaf-spring

final Map<String,Object> executionAttributes = configuration.getExecutionAttributes();
origin: com.foreach.across.modules/spring-mobile-module

  /**
   * This method replaces the attribute device:replace="XXX" with th:replace"DEVICE_PREFIX/XXX"
   * This is useful for including device specific fragments
   */
  @Override
  protected void doProcess( ITemplateContext context,
               IProcessableElementTag tag,
               AttributeName attributeName,
               String attributeValue,
               IElementTagStructureHandler structureHandler ) {
    ApplicationContext applicationContext
        = (ApplicationContext) context.getConfiguration()
                       .getExecutionAttributes()
                       .get( DeviceDialect.APPLICATION_CONTEXT_ATTRIBUTE );
    DeviceBasedViewNameResolver deviceBasedViewNameResolver
        = applicationContext.getBean( DeviceBasedViewNameResolver.class );

    structureHandler.setAttribute(
        StandardDialect.PREFIX + ":" + StandardReplaceTagProcessor.ATTR_NAME,
        deviceBasedViewNameResolver.resolveDeviceSpecificView( attributeValue )
    );
  }
}
org.thymeleafIEngineConfigurationgetExecutionAttributes

Popular methods of IEngineConfiguration

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

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JComboBox (javax.swing)
  • JFileChooser (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • From CI to AI: The AI layer in your organization
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