Class BuildLogRegexMacro
- java.lang.Object
-
- org.jenkinsci.plugins.tokenmacro.TokenMacro
-
- org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
-
- org.jenkinsci.plugins.tokenmacro.impl.BuildLogRegexMacro
-
- All Implemented Interfaces:
ExtensionPoint
@Extension public class BuildLogRegexMacro extends DataBoundTokenMacro
An EmailContent for build log lines matching a regular expression. Shows lines matching a regular expression (with optional context lines) from the build log file.- Author:
- krwalker@stellarscience.com
-
-
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 boolean
addNewline
String
defaultValue
boolean
greedy
static int
LINES_AFTER_DEFAULT_VALUE
static int
LINES_BEFORE_DEFAULT_VALUE
int
linesAfter
int
linesBefore
static String
MACRO_NAME
String
matchedLineHtmlStyle
static int
MAX_LINE_LENGTH_DEFAULT_VALUE
static int
MAX_MATCHES_DEFAULT_VALUE
static int
MAX_TAIL_MATCHES_DEFAULT_VALUE
int
maxLineLength
int
maxMatches
int
maxTailMatches
String
regex
boolean
showTruncatedLines
String
substText
-
Fields inherited from class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
escapeHtml
-
-
Constructor Summary
Constructors Constructor Description BuildLogRegexMacro()
-
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<?,?> build, TaskListener listener, String macroName)
String
evaluate(Run<?,?> run, FilePath workspace, TaskListener listener, String macroName)
List<String>
getAcceptedMacroNames()
boolean
handlesHtmlEscapeInternally()
Indicates whether this macro handlesDataBoundTokenMacro.escapeHtml
on its own inside theevaluate
methods.-
Methods inherited from class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
evaluate, evaluate, hasNestedContent
-
Methods inherited from class org.jenkinsci.plugins.tokenmacro.TokenMacro
all, expand, expand, expand, expand, expandAll, expandAll, expandAll, expandAll, getAutoCompleteList, getPreviousRun, getWorkspace
-
-
-
-
Field Detail
-
MACRO_NAME
public static final String MACRO_NAME
- See Also:
- Constant Field Values
-
LINES_BEFORE_DEFAULT_VALUE
public static final int LINES_BEFORE_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
LINES_AFTER_DEFAULT_VALUE
public static final int LINES_AFTER_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
MAX_MATCHES_DEFAULT_VALUE
public static final int MAX_MATCHES_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
MAX_TAIL_MATCHES_DEFAULT_VALUE
public static final int MAX_TAIL_MATCHES_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
MAX_LINE_LENGTH_DEFAULT_VALUE
public static final int MAX_LINE_LENGTH_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
regex
public String regex
-
linesBefore
public int linesBefore
-
linesAfter
public int linesAfter
-
maxMatches
public int maxMatches
-
showTruncatedLines
public boolean showTruncatedLines
-
substText
public String substText
-
matchedLineHtmlStyle
public String matchedLineHtmlStyle
-
addNewline
public boolean addNewline
-
defaultValue
public String defaultValue
-
greedy
public boolean greedy
-
maxTailMatches
public int maxTailMatches
-
maxLineLength
public int maxLineLength
-
-
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<?,?> build, 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
-
handlesHtmlEscapeInternally
public boolean handlesHtmlEscapeInternally()
Description copied from class:DataBoundTokenMacro
Indicates whether this macro handlesDataBoundTokenMacro.escapeHtml
on its own inside theevaluate
methods. If this method returnsfalse
andDataBoundTokenMacro.escapeHtml
istrue
then the returned value fromDataBoundTokenMacro.evaluate(AbstractBuild, TaskListener, String)
andDataBoundTokenMacro.evaluate(Run, FilePath, TaskListener, String)
will be escaped. If this method returnstrue
no escaping will be performed, and it is assumed the escaping will be handled internally by the implementing class. It is then also assumed that thehelp.jelly
file for that class mentions theDataBoundTokenMacro.escapeHtml
parameter.- Overrides:
handlesHtmlEscapeInternally
in classDataBoundTokenMacro
- Returns:
- true if the implementing class handles its own html escaping.
-
-