Package org.apache.juneau.svl
Class VarResolverSession
java.lang.Object
org.apache.juneau.svl.VarResolverSession
A var resolver session that combines a 
VarResolver with one or more session objects.
 Instances of this class are considered light-weight and fast to construct, use, and discard.
This class contains the workhorse code for var resolution.
 Instances of this class are created through the VarResolver.createSession() and
 VarResolver.createSession(BeanStore) methods.
 
Notes:
- This class is not guaranteed to be thread safe.
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds a bean to this session.<T> Optional<T>Returns the bean from the registered bean store.protected VarReturns theVarwith the specified name.Resolve all variables in the specified string.String[]Resolves the specified strings in the string array.<T> Tresolve(T o) Convenience method for resolving variables in arbitrary objects.Resolves variables in the specified string and sends the output to the specified writer.toString()
- 
Constructor Details- 
VarResolverSessionConstructor.- Parameters:
- context- The- VarResolvercontext object that contains the- Varsand context objects associated with that resolver.
- beanStore- The bean store to use for resolving beans needed by vars.
 
 
- 
- 
Method Details- 
resolveResolve all variables in the specified string.- Parameters:
- s- The string to resolve variables in.
- Returns:
- The new string with all variables resolved, or the same string if no variables were found.
   
 Returnsnull if the input wasnull .
 
- 
resolveConvenience method for resolving variables in arbitrary objects.Supports resolving variables in the following object types: - CharSequence
- Arrays containing values of type CharSequence.
- Collections containing values of type CharSequence.
 Collection class must have a no-arg constructor.
- Maps containing values of type CharSequence.
 Map class must have a no-arg constructor.
 - Type Parameters:
- T- The value type.
- Parameters:
- o- The object.
- Returns:
- The same object if no resolution was needed, otherwise a new object or data structure if resolution was needed.
 
- 
resolveToResolves variables in the specified string and sends the output to the specified writer.More efficient than first parsing to a string and then serializing to the writer since this method doesn't need to construct a large string. - Parameters:
- s- The string to resolve variables in.
- out- The writer to write to.
- Returns:
- The same writer.
- Throws:
- IOException- Thrown by underlying stream.
 
- 
getBeanReturns the bean from the registered bean store.- Type Parameters:
- T- The value type.
- Parameters:
- c- The bean type.
- Returns:
- The bean.
   
 Nevernull .
 
- 
getVarReturns theVarwith the specified name.- Parameters:
- name- The var name (e.g.- "S" ).
- Returns:
- The Varinstance, ornull if noVar is associated with the specified name.
 
- 
resolveResolves the specified strings in the string array.- Parameters:
- in- The string array containing variables to resolve.
- Returns:
- An array with resolved strings.
 
- 
beanAdds a bean to this session.- Type Parameters:
- T- The bean type.
- Parameters:
- c- The bean type.
- value- The bean.
- Returns:
- This object.
 
- 
toString
 
-