public class VarResolverBuilder extends Object
VarResolver
.
Constructor and Description |
---|
VarResolverBuilder() |
Modifier and Type | Method and Description |
---|---|
VarResolver |
build()
Create a new var resolver using the settings in this builder.
|
VarResolverBuilder |
contextObject(String name,
Object object)
Associates a context object with this resolver.
|
VarResolverBuilder |
contextObjects(Map<String,Object> map)
Associates multiple context objects with this resolver.
|
VarResolverBuilder |
defaultVars()
Adds the default variables to this builder.
|
VarResolverBuilder |
vars(Class<?>... vars)
Register new variables with this resolver.
|
public VarResolverBuilder()
public VarResolver build()
public VarResolverBuilder vars(Class<?>... vars)
vars
- The variable resolver classes.
These classes must subclass from Var
and have no-arg constructors.public VarResolverBuilder defaultVars()
The default variables are:
public VarResolverBuilder contextObject(String name, Object object)
A context object is essentially some environmental object that doesn't change but is used by vars to customize output.
name
- The name of the context object.object
- The context object.public VarResolverBuilder contextObjects(Map<String,Object> map)
A context object is essentially some environmental object that doesn't change but is used by vars to customize output.
map
- A map of context objects keyed by their name.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.