Class Renderer
- java.lang.Object
-
- com.sonyericsson.jenkins.plugins.bfa.tokens.Renderer
-
public class Renderer extends Object
Renderer for the Token mechanims. Provides options to render based onFailureCauseBuildAction
orFailureCauseMatrixBuildAction
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Renderer.IndicationUrlBuilder
Helps build a URL into the build log for an indication.
-
Constructor Summary
Constructors Constructor Description Renderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addFailureCauseDisplayDataRepresentation(StringBuilder stringBuilder, FailureCauseDisplayData data, int indentLevel)
protected void
addTitle(StringBuilder stringBuilder)
Add the "Identified problems:" title to the output.protected void
appendHtmlOrPlain(StringBuilder stringBuilder, String htmlText, String plainText)
Append either the html or plain text given to the StringBuilder, depending on "useHtmlFormat" value.String
render(FailureCauseBuildAction action)
Renders the Causes as provided by the action.String
render(FailureCauseMatrixBuildAction matrixAction)
Renders the Causes as provided by the action.void
setEscapeHtml(boolean escapeHtml)
SeeDataBoundTokenMacro.escapeHtml
.void
setIncludeIndications(boolean includeIndications)
void
setIncludeTitle(boolean includeTitle)
void
setNoFailureText(String noFailureText)
void
setUseHtmlFormat(boolean useHtmlFormat)
void
setWrapWidth(int wrapWidth)
-
-
-
Method Detail
-
setIncludeIndications
public void setIncludeIndications(boolean includeIndications)
- Parameters:
includeIndications
- When true, the indication numbers and links into the console log are included in the token replacement text.
-
setUseHtmlFormat
public void setUseHtmlFormat(boolean useHtmlFormat)
- Parameters:
useHtmlFormat
- When true, the replacement text will be an HTML snippet.
-
setIncludeTitle
public void setIncludeTitle(boolean includeTitle)
- Parameters:
includeTitle
- When true, the title will appear in the token replacement text.
-
setWrapWidth
public void setWrapWidth(int wrapWidth)
- Parameters:
wrapWidth
- Wrap long lines at this width. If wrapWidth is 0, the text isn't wrapped. Only applies if useHtmlFormat == false.
-
setNoFailureText
public void setNoFailureText(String noFailureText)
- Parameters:
noFailureText
- Text to return when no failure cause is present.
-
setEscapeHtml
public void setEscapeHtml(boolean escapeHtml)
SeeDataBoundTokenMacro.escapeHtml
. Only applicable whenuseHtmlFormat
==false
- Parameters:
escapeHtml
- true if so.
-
appendHtmlOrPlain
protected void appendHtmlOrPlain(StringBuilder stringBuilder, String htmlText, String plainText)
Append either the html or plain text given to the StringBuilder, depending on "useHtmlFormat" value.- Parameters:
stringBuilder
- TheStringBuilder
to append to.htmlText
- Text to append in case of html, can be null.plainText
- Text to append in case of plain text, can be null.
-
render
public String render(FailureCauseBuildAction action)
Renders the Causes as provided by the action.- Parameters:
action
- The action containing the causes- Returns:
- The formatted causes.
-
addTitle
protected void addTitle(StringBuilder stringBuilder)
Add the "Identified problems:" title to the output.- Parameters:
stringBuilder
- the string builder to which to add the title
-
addFailureCauseDisplayDataRepresentation
protected void addFailureCauseDisplayDataRepresentation(StringBuilder stringBuilder, FailureCauseDisplayData data, int indentLevel)
- Parameters:
stringBuilder
- the string builder to which to add the failure cause data representationdata
- the failure cause display dataindentLevel
- the indent level
-
render
public String render(FailureCauseMatrixBuildAction matrixAction)
Renders the Causes as provided by the action.- Parameters:
matrixAction
- The action containing the causes- Returns:
- The formatted causes.
-
-