Package net.sourceforge.pmd.reporting
Class ConfigurableFileNameRenderer
- java.lang.Object
-
- net.sourceforge.pmd.reporting.ConfigurableFileNameRenderer
-
- All Implemented Interfaces:
FileNameRenderer
public class ConfigurableFileNameRenderer extends Object implements FileNameRenderer
- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description ConfigurableFileNameRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDisplayName(@NonNull FileId fileId)
Return a display name for the given file id.void
relativizeWith(Path path)
Add a prefix that is used to relativize file paths as their display name.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.reporting.FileNameRenderer
getDisplayName
-
-
-
-
Method Detail
-
relativizeWith
public void relativizeWith(Path path)
Add a prefix that is used to relativize file paths as their display name. For instance, when adding a file/tmp/src/main/java/org/foo.java
, and relativizing with/tmp/src/
, the registeredTextFile
will have a path id of/tmp/src/main/java/org/foo.java
, and a display name ofmain/java/org/foo.java
.This only matters for files added from a
Path
object.- Parameters:
path
- Path with which to relativize
-
getDisplayName
public String getDisplayName(@NonNull FileId fileId)
Description copied from interface:FileNameRenderer
Return a display name for the given file id.- Specified by:
getDisplayName
in interfaceFileNameRenderer
- Parameters:
fileId
- A file id- Returns:
- A display name
-
-