Package com.github.jknack.handlebars
Class Context.Builder
- java.lang.Object
-
- com.github.jknack.handlebars.Context.Builder
-
- Enclosing class:
- Context
public static final class Context.Builder extends java.lang.Object
A context builder.- Since:
- 0.1.1
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
build()
Build a context stack.Context.Builder
combine(java.lang.String name, java.lang.Object model)
Combine the given model using the specified name.Context.Builder
combine(java.util.Map<java.lang.String,?> model)
Combine all the map entries into the context stack.Context.Builder
push(ValueResolver... resolvers)
Add one or more value resolver to the defaults defined byValueResolver.defaultValueResolvers()
.Context.Builder
resolver(ValueResolver... resolvers)
Set the value resolvers to use.
-
-
-
Method Detail
-
combine
public Context.Builder combine(java.lang.String name, java.lang.Object model)
Combine the given model using the specified name.- Parameters:
name
- The variable's name. Required.model
- The model data.- Returns:
- This builder.
-
combine
public Context.Builder combine(java.util.Map<java.lang.String,?> model)
Combine all the map entries into the context stack.- Parameters:
model
- The model data.- Returns:
- This builder.
-
resolver
public Context.Builder resolver(ValueResolver... resolvers)
Set the value resolvers to use.- Parameters:
resolvers
- The value resolvers. Required.- Returns:
- This builder.
-
push
public Context.Builder push(ValueResolver... resolvers)
Add one or more value resolver to the defaults defined byValueResolver.defaultValueResolvers()
.- Parameters:
resolvers
- The value resolvers. Required.- Returns:
- This builder.
-
build
public Context build()
Build a context stack.- Returns:
- A new context stack.
-
-