VarResolver
The Microservice API incorporates the Simple Variable Language API. The variable resolver can be augmented through the following methods:
A typical usage pattern is shown below:
// $A used in variable resolver.
VarResolver varResolver = Microservice.getInstance().getVarResolver();
System.out.println(varResolver.resolve("Main class is set to $MF{Main-Class, unknown}"));
The variable resolver becomes much more powerful when used in REST resource annotations which will be described latter in juneau-microservice-jetty By default, support for the following variables are provided:
$S{key[,default]}- SystemPropertiesVar$E{key[,default]}- EnvVariablesVar$A{key[,default]}- ArgsVar$C{key[,default]}- ConfigVar$MF{key[,default]}- ManifestFileVar$IF{arg,then[,else]}- IfVar$SW{arg,pattern1:then1[,pattern2:then2...]}- SwitchVar$CO{arg[,arg2...]}- CoalesceVar$PM{arg,pattern}- PatternMatchVar$UC{arg}- UpperCaseVar$LC{arg}- LowerCaseVar$NE{arg}- NotEmptyVar
Share feedback or follow-up questions for this page directly through GitHub.