Package hudson.util
Interface VariableResolver<V>
- All Known Implementing Classes:
VariableResolver.ByMap,VariableResolver.Union
public interface VariableResolver<V>
Resolves variables to its value, while encapsulating
how that resolution happens.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classVariableResolverbacked by aMap.static final classUnion of multipleVariableResolver. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VariableResolverEmpty resolver that always returns null. -
Method Summary
-
Field Details
-
NONE
Empty resolver that always returns null.
-
-
Method Details
-
resolve
Receives a variable name and obtains the value associated with the name.This can be implemented simply on top of a
Map(seeVariableResolver.ByMap), or this can be used like an expression evaluator.- Parameters:
name- Name of the variable to be resolved. Never null, never empty. The name shouldn't include the syntactic marker of an expression. IOW, it should be "foo" but not "${foo}". A part of the goal of this design is to abstract away the expression marker syntax.- Returns:
- Object referenced by the name. Null if not found.
-