Class XmlFileMacro
- java.lang.Object
-
- org.jenkinsci.plugins.tokenmacro.TokenMacro
-
- org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
-
- org.jenkinsci.plugins.tokenmacro.impl.XmlFileMacro
-
- All Implemented Interfaces:
ExtensionPoint
@Extension public class XmlFileMacro extends DataBoundTokenMacro
Expands to a xml value(s) from a xml file relative to the workspace root. If xpath evaluates to more than one value then a semicolon separted string is returned.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
DataBoundTokenMacro.Parameter
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description String
file
static Logger
LOGGER
String
xpath
-
Fields inherited from class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
escapeHtml
-
-
Constructor Summary
Constructors Constructor Description XmlFileMacro()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsMacroName(String macroName)
Returns true if this object can evaluate the macro of the given name.String
evaluate(AbstractBuild<?,?> context, TaskListener listener, String macroName)
String
evaluate(Run<?,?> run, FilePath workspace, TaskListener listener, String macroName)
List<String>
getAcceptedMacroNames()
-
Methods inherited from class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
evaluate, evaluate, handlesHtmlEscapeInternally, hasNestedContent
-
Methods inherited from class org.jenkinsci.plugins.tokenmacro.TokenMacro
all, expand, expand, expand, expand, expandAll, expandAll, expandAll, expandAll, getAutoCompleteList, getPreviousRun, getWorkspace
-
-
-
-
Method Detail
-
acceptsMacroName
public boolean acceptsMacroName(String macroName)
Description copied from class:TokenMacro
Returns true if this object can evaluate the macro of the given name.- Specified by:
acceptsMacroName
in classTokenMacro
- Parameters:
macroName
- By convention we encourage all caps name.- Returns:
- true
... to claim the macro of the given name and have
TokenMacro.evaluate(AbstractBuild, TaskListener, String, Map, ListMultimap)
called.
-
getAcceptedMacroNames
public List<String> getAcceptedMacroNames()
- Overrides:
getAcceptedMacroNames
in classTokenMacro
-
evaluate
public String evaluate(AbstractBuild<?,?> context, TaskListener listener, String macroName) throws MacroEvaluationException, IOException, InterruptedException
- Specified by:
evaluate
in classDataBoundTokenMacro
- Throws:
MacroEvaluationException
IOException
InterruptedException
-
evaluate
public String evaluate(Run<?,?> run, FilePath workspace, TaskListener listener, String macroName) throws MacroEvaluationException, IOException, InterruptedException
- Overrides:
evaluate
in classDataBoundTokenMacro
- Throws:
MacroEvaluationException
IOException
InterruptedException
-
-