org.thymeleaf.context.IExpressionContext Java Examples

The following examples show how to use org.thymeleaf.context.IExpressionContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThymeleafTemplateEngineImpl.java    From vertx-web with Apache License 2.0 6 votes vote down vote up
public ThymeleafTemplateEngineImpl(Vertx vertx) {
  ResourceTemplateResolver templateResolver = new ResourceTemplateResolver(vertx);
  templateResolver.setCacheable(!WebEnvironment.development());
  templateResolver.setTemplateMode(ThymeleafTemplateEngine.DEFAULT_TEMPLATE_MODE);

  this.templateResolver = templateResolver;
  this.templateEngine.setTemplateResolver(templateResolver);
  // There's no servlet context in Vert.x, so we override default link builder
  // See https://github.com/vert-x3/vertx-web/issues/161
  this.templateEngine.setLinkBuilder(new StandardLinkBuilder() {
    @Override
    protected String computeContextPath(
      final IExpressionContext context, final String base, final Map<String, Object> parameters) {
      return "/";
    }
  });
}
 
Example #2
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 6 votes vote down vote up
@Override
public Object buildObject(IExpressionContext context, String expressionObjectName) {
	switch (expressionObjectName) {
		case POSTS_EXPRESSION_OBJECT_NAME:
			return createPosts(context);
		case ARTICLES_EXPRESSION_OBJECT_NAME:
			return createArticles(context);
		case PAGES_EXPRESSION_OBJECT_NAME:
			return createPages(context);
		case CATEGORIES_EXPRESSION_OBJECT_NAME:
			return createCategories(context);
		case TAGS_EXPRESSION_OBJECT_NAME:
			return createTags(context);
		case MEDIAS_EXPRESSION_OBJECT_NAME:
			return createMedias(context);
		case USERS_EXPRESSION_OBJECT_NAME:
			return createUsers(context);
		case DEVICES_EXPRESSION_OBJECT_NAME:
			return createDevices(context);
		default:
			return null;
	}
}
 
Example #3
Source File: SecurityExpressionObjectFactory.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 5 votes vote down vote up
@Override
public Object buildObject(IExpressionContext context,
						  String expressionObjectName) {
	if (expressionObjectName.equals("authorization")) {
		if (context instanceof ISpringWebFluxContext) {
			return new Authorization(
				(ISpringWebFluxContext) context, handler);
		}
	}
	return null;
}
 
Example #4
Source File: Expressions.java    From thymeleaf-spring-data-dialect with Apache License 2.0 5 votes vote down vote up
public static Object evaluate(IExpressionContext context, String expressionValue) {
    final String value = String.valueOf(expressionValue).trim();
    final IStandardExpressionParser expressionParser = StandardExpressions
            .getExpressionParser(context.getConfiguration());
    final IStandardExpression expression = expressionParser.parseExpression(context, value);

    return expression.execute(context);
}
 
Example #5
Source File: SecurityExpressionObjectFactory.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 5 votes vote down vote up
@Override
public Object buildObject(IExpressionContext context,
						  String expressionObjectName) {
	if (expressionObjectName.equals("authorization")) {
		if (context instanceof ISpringWebFluxContext) {
			return new Authorization(
				(ISpringWebFluxContext) context, handler);
		}
	}
	return null;
}
 
Example #6
Source File: GlobalUtilExpressionObjectFactory.java    From Dodder with MIT License 5 votes vote down vote up
@Override
public Object buildObject(IExpressionContext context, String expressionObjectName) {
	if (expressionObjectName.equals(GLOBAL_UTIL__EVALUATION_VARIABLE_NAME)) {
		return new StringUtil();
	}
	return null;
}
 
Example #7
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Posts createPosts(IExpressionContext context) {
	return new Posts(context, postUtils, wallRideProperties);
}
 
Example #8
Source File: Medias.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Medias(IExpressionContext context, WallRideProperties wallRideProperties) {
	this.context = context;
	this.wallRideProperties = wallRideProperties;
}
 
Example #9
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Devices createDevices(IExpressionContext context) {
	return new Devices(context, new LiteDeviceResolver());
}
 
Example #10
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Users createUsers(IExpressionContext context) {
	return new Users(context, wallRideProperties);
}
 
Example #11
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Medias createMedias(IExpressionContext context) {
	return new Medias(context, wallRideProperties);
}
 
Example #12
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Tags createTags(IExpressionContext context) {
	return new Tags(context, tagUtils);
}
 
Example #13
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Categories createCategories(IExpressionContext context) {
	return new Categories(context, categoryUtils);
}
 
Example #14
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Pages createPages(IExpressionContext context) {
	return new Pages(context, pageUtils);
}
 
Example #15
Source File: WallRideExpressionObjectFactory.java    From wallride with Apache License 2.0 4 votes vote down vote up
protected Articles createArticles(IExpressionContext context) {
	return new Articles(context, articleUtils);
}
 
Example #16
Source File: Tags.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Tags(IExpressionContext context, TagUtils TagUtils) {
	this.context = context;
	this.tagUtils = TagUtils;
}
 
Example #17
Source File: MapExpressionObjectFactory.java    From purplejs with Apache License 2.0 4 votes vote down vote up
@Override
public Object buildObject( final IExpressionContext context, final String name )
{
    return this.map.get( name );
}
 
Example #18
Source File: Posts.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Posts(IExpressionContext context, PostUtils postUtils, WallRideProperties wallRideProperties) {
	this.context = context;
	this.postUtils = postUtils;
	this.wallRideProperties = wallRideProperties;
}
 
Example #19
Source File: Devices.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Devices (IExpressionContext context, DeviceResolver deviceResolver) {
	this.context = context;
	this.deviceResolver = deviceResolver;
}
 
Example #20
Source File: Categories.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Categories(IExpressionContext context, CategoryUtils CategoryUtils) {
	this.context = context;
	this.CategoryUtils = CategoryUtils;
}
 
Example #21
Source File: Users.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Users(IExpressionContext context, WallRideProperties wallRideProperties) {
	this.context = context;
	this.wallRideProperties = wallRideProperties;
}
 
Example #22
Source File: Articles.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Articles(IExpressionContext context, ArticleUtils articleUtils) {
	this.context = context;
	this.articleUtils = articleUtils;
}
 
Example #23
Source File: Pages.java    From wallride with Apache License 2.0 4 votes vote down vote up
public Pages(IExpressionContext context, PageUtils pageUtils) {
	this.context = context;
	this.pageUtils = pageUtils;
}