Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-9535] Persist example message of dynamic parsers.
  • Loading branch information
uhafner committed Jun 15, 2011
1 parent 9f8762b commit 97af2fb
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/main/java/hudson/plugins/warnings/GroovyParser.java
Expand Up @@ -20,6 +20,8 @@ public class GroovyParser {
private final String name;
private final String regexp;
private final String script;
/** @since 3.18. */
private final String example;

/**
* Creates a new instance of {@link GroovyParser}.
Expand All @@ -30,12 +32,29 @@ public class GroovyParser {
* the regular expression
* @param script
* the script to map the expression to a warning
* @param example
* the example to verify the parser
*/
@DataBoundConstructor
public GroovyParser(final String name, final String regexp, final String script) {
public GroovyParser(final String name, final String regexp, final String script, final String example) {
this.name = name;
this.regexp = regexp;
this.script = script;
this.example = example;
}

/**
* Creates a new instance of {@link GroovyParser}.
*
* @param name
* the name of the parser
* @param regexp
* the regular expression
* @param script
* the script to map the expression to a warning
*/
public GroovyParser(final String name, final String regexp, final String script) {
this(name, regexp, script, StringUtils.EMPTY);
}

/**
Expand Down Expand Up @@ -77,6 +96,16 @@ public String getScript() {
return script;
}

/**
* Returns the example to verify the parser.
*
* @return the example
* @since 3.18
*/
public String getExample() {
return StringUtils.defaultString(example);
}

/**
* Returns whether the parser can scan messages spanning multiple lines.
*
Expand Down

0 comments on commit 97af2fb

Please sign in to comment.