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 StringgetDisplayName(@NonNull FileId fileId)Return a display name for the given file id.voidrelativizeWith(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 registeredTextFilewill 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
Pathobject.- Parameters:
path- Path with which to relativize
-
getDisplayName
public String getDisplayName(@NonNull FileId fileId)
Description copied from interface:FileNameRendererReturn a display name for the given file id.- Specified by:
getDisplayNamein interfaceFileNameRenderer- Parameters:
fileId- A file id- Returns:
- A display name
-
-