VarResolver

The Microservice API incorporates the {@doc juneau-marshall.SimpleVariableLanguage Simple Variable Language} API.

The variable resolver can be augmented through the following methods:

- {@link oaj.microservice.MicroserviceBuilder}
  - {@link oaj.microservice.MicroserviceBuilder#vars(Class...) vars(Class...)}
  - {@link oaj.microservice.MicroserviceBuilder#varContext(String, Object) varContext(String,Object)}

A typical usage pattern is shown below:

// $A used in variable resolver. VarResolver vr = Microservice.getInstance().getVarResolver(); System.out.println(vr.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 {@doc juneau-microservice-jetty}

By default, support for the following variables are provided:

- $S{key[,default]} - {@link oaj.svl.vars.SystemPropertiesVar}
- $E{key[,default]} - {@link oaj.svl.vars.EnvVariablesVar}
- $A{key[,default]} - {@link oaj.svl.vars.ArgsVar}
- $C{key[,default]} - {@link oaj.config.vars.ConfigVar}
- $MF{key[,default]} - {@link oaj.svl.vars.ManifestFileVar}
- $IF{arg,then[,else]} - {@link oaj.svl.vars.IfVar}
- $SW{arg,pattern1:then1[,pattern2:then2...]} - {@link oaj.svl.vars.SwitchVar}
- $CO{arg[,arg2...]} - {@link oaj.svl.vars.CoalesceVar}
- $PM{arg,pattern} - {@link oaj.svl.vars.PatternMatchVar}
- $UC{arg} - {@link oaj.svl.vars.UpperCaseVar}
- $LC{arg} - {@link oaj.svl.vars.LowerCaseVar}
- $NE{arg} - {@link oaj.svl.vars.NotEmptyVar}