Class FileNameRenderer
- java.lang.Object
-
- io.jenkins.plugins.analysis.core.model.FileNameRenderer
-
public class FileNameRenderer extends Object
Renders the name of an affected file of an issue. If the affected file is accessible, then a hyper link is created. Otherwise, the plain text of the base name is created.- Author:
- Ullrich Hafner
-
-
Constructor Summary
Constructors Constructor Description FileNameRenderer(Run<?,?> build)
Creates a newFileNameRenderer
.FileNameRenderer(Run<?,?> build, BuildFolderFacade facade)
Creates a newFileNameRenderer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description j2html.tags.DomContent
createAffectedFileLink(edu.hm.hafner.analysis.Issue issue)
Returns an HTML link that references the UI representation of the affected file of the specified issue.j2html.tags.DomContent
createAffectedFileLink(edu.hm.hafner.analysis.Issue issue, String prefix)
Returns an HTML link that references the UI representation of the affected file of the specified issue.String
getFileName(edu.hm.hafner.analysis.Issue issue)
Returns the base name of the affected file of the specified issue.String
getFileNameAtLine(edu.hm.hafner.analysis.Issue issue)
Returns the base name of the affected file of the specified issue (including the specified line number).String
getSourceCodeUrl(edu.hm.hafner.analysis.Issue issue)
Returns the URL to show the source code with the affected issue line.String
renderAffectedFileLink(edu.hm.hafner.analysis.Issue issue)
Returns the String representation of an HTML link that references the UI representation of the affected file of the specified issue.
-
-
-
Constructor Detail
-
FileNameRenderer
public FileNameRenderer(Run<?,?> build)
Creates a newFileNameRenderer
.- Parameters:
build
- the build to obtain the affected file from
-
FileNameRenderer
public FileNameRenderer(Run<?,?> build, BuildFolderFacade facade)
Creates a newFileNameRenderer
.- Parameters:
build
- the build to obtain the affected file fromfacade
- facade to the build folder that contains the affected files
-
-
Method Detail
-
renderAffectedFileLink
public String renderAffectedFileLink(edu.hm.hafner.analysis.Issue issue)
Returns the String representation of an HTML link that references the UI representation of the affected file of the specified issue.- Parameters:
issue
- the issue to create the link for- Returns:
- the link (if the file is accessible)
- See Also:
createAffectedFileLink(Issue)
-
createAffectedFileLink
public j2html.tags.DomContent createAffectedFileLink(edu.hm.hafner.analysis.Issue issue)
Returns an HTML link that references the UI representation of the affected file of the specified issue.- Parameters:
issue
- the issue to create the link for- Returns:
- the link (if the file is accessible)
-
createAffectedFileLink
public j2html.tags.DomContent createAffectedFileLink(edu.hm.hafner.analysis.Issue issue, String prefix)
Returns an HTML link that references the UI representation of the affected file of the specified issue.- Parameters:
issue
- the issue to create the link forprefix
- prefix to the file name URL- Returns:
- the link (if the file is accessible)
-
getSourceCodeUrl
public String getSourceCodeUrl(edu.hm.hafner.analysis.Issue issue)
Returns the URL to show the source code with the affected issue line.- Parameters:
issue
- the issue to show the source code for- Returns:
- the URL
-
getFileNameAtLine
public String getFileNameAtLine(edu.hm.hafner.analysis.Issue issue)
Returns the base name of the affected file of the specified issue (including the specified line number).- Parameters:
issue
- the issue to get the base name for- Returns:
- the file name
-
getFileName
public String getFileName(edu.hm.hafner.analysis.Issue issue)
Returns the base name of the affected file of the specified issue.- Parameters:
issue
- the issue to get the base name for- Returns:
- the file name
-
-