Class Renderer
java.lang.Object
com.sonyericsson.jenkins.plugins.bfa.tokens.Renderer
Renderer for the Token mechanims. Provides options to render based on
FailureCauseBuildAction
or
FailureCauseMatrixBuildAction
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Helps build a URL into the build log for an indication. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.render
(FailureCauseBuildAction action) Renders the Causes as provided by the action.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)
-
Constructor Details
-
Renderer
public Renderer()
-
-
Method Details
-
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
- 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
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
Renders the Causes as provided by the action.- Parameters:
action
- The action containing the causes- Returns:
- The formatted causes.
-
addTitle
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
Renders the Causes as provided by the action.- Parameters:
matrixAction
- The action containing the causes- Returns:
- The formatted causes.
-