Class 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 Detail

      • FileNameRenderer

        public FileNameRenderer​(Run<?,​?> build)
        Creates a new FileNameRenderer.
        Parameters:
        build - the build to obtain the affected file from
      • FileNameRenderer

        public FileNameRenderer​(Run<?,​?> build,
                                BuildFolderFacade facade)
        Creates a new FileNameRenderer.
        Parameters:
        build - the build to obtain the affected file from
        facade - 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 for
        prefix - 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