Class VarResolver
 Variables are of the form 
The variable key can contain anything, even nested variables that get recursively resolved.
 
 Variables are defined through the VarResolver.Builder.vars(Class[]) method.
 
 The Var interface defines how variables are converted to values.
 
Example:
   
See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final VarResolverDefault string variable resolver with support for system properties and environment variables:$S{key[,default]} -SystemPropertiesVar$E{key[,default]} -EnvVariablesVar$A{key[,default]} -ArgsVar$MF{key[,default]} -ManifestFileVar$SW{stringArg,pattern:thenValue[,pattern:thenValue...]} -SwitchVar$IF{arg,then[,else]} -IfVar$CO{arg[,arg2...]} -CoalesceVar$PM{arg,pattern} -PatternMatchVar$PR{stringArg,pattern,replace} -PatternReplaceVar$PE{arg,pattern,groupIndex} -PatternExtractVar$UC{arg} -UpperCaseVar$LC{arg} -LowerCaseVar$NE{arg} -NotEmptyVar$LN{arg[,delimiter]} -LenVar$ST{arg,start[,end]} -SubstringVar
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<T> VarResolverAdds a bean to this session.copy()Returns a new builder object using the settings in this resolver as a base.static VarResolver.Buildercreate()Instantiates a new clean-slateVarResolver.Builderobject.Creates a new resolver session with no session objects.createSession(BeanStore beanStore) Same ascreateSession()except allows you to specify a bean store for resolving beans.Returns an unmodifiable map ofVarsassociated with this context.protected Var[]getVars()Returns an array of variables define in this variable resolver context.Resolve variables in the specified string.voidResolve variables in the specified string and sends the results to the specified writer.
- 
Field Details- 
DEFAULTDefault string variable resolver with support for system properties and environment variables:- $S{key[,default]} -- SystemPropertiesVar
- $E{key[,default]} -- EnvVariablesVar
- $A{key[,default]} -- ArgsVar
- $MF{key[,default]} -- ManifestFileVar
- $SW{stringArg,pattern:thenValue[,pattern:thenValue...]} -- SwitchVar
- $IF{arg,then[,else]} -- IfVar
- $CO{arg[,arg2...]} -- CoalesceVar
- $PM{arg,pattern} -- PatternMatchVar
- $PR{stringArg,pattern,replace} -- PatternReplaceVar
- $PE{arg,pattern,groupIndex} -- PatternExtractVar
- $UC{arg} -- UpperCaseVar
- $LC{arg} -- LowerCaseVar
- $NE{arg} -- NotEmptyVar
- $LN{arg[,delimiter]} -- LenVar
- $ST{arg,start[,end]} -- SubstringVar
 
 
- 
- 
Constructor Details- 
VarResolverConstructor.- Parameters:
- builder- The builder for this object.
 
 
- 
- 
Method Details- 
createInstantiates a new clean-slateVarResolver.Builderobject.- Returns:
- A new VarResolver.Builderobject.
 
- 
copyReturns a new builder object using the settings in this resolver as a base.- Returns:
- A new var resolver builder.
 
- 
getVarMapReturns an unmodifiable map ofVarsassociated with this context.- Returns:
- A map whose keys are var names (e.g. "S" ) and values areVarinstances.
 
- 
getVarsReturns an array of variables define in this variable resolver context.- Returns:
- A new array containing the variables in this context.
 
- 
addBeanAdds a bean to this session.- Type Parameters:
- T- The bean type.
- Parameters:
- c- The bean type.
- value- The bean.
- Returns:
- This object .
 
- 
createSessionCreates a new resolver session with no session objects.- Returns:
- A new resolver session.
 
- 
createSessionSame ascreateSession()except allows you to specify a bean store for resolving beans.- Parameters:
- beanStore- The bean store to associate with this session.
- Returns:
- A new resolver session.
 
- 
resolveResolve variables in the specified string.This is a shortcut for calling createSession(.null ).resolve(s);
 This method can only be used if the string doesn't contain variables that rely on the existence of session variables.- Parameters:
- s- The input string.
- Returns:
- The string with variables resolved, or the same string if it doesn't contain any variables to resolve.
 
- 
resolveToResolve variables in the specified string and sends the results to the specified writer.This is a shortcut for calling createSession(.null ).resolveTo(s, w);
 This method can only be used if the string doesn't contain variables that rely on the existence of session variables.- Parameters:
- s- The input string.
- w- The writer to send the result to.
- Throws:
- IOException- Thrown by underlying stream.
 
 
-