Class TreeRenderers
- java.lang.Object
-
- net.sourceforge.pmd.util.treeexport.TreeRenderers
-
public final class TreeRenderers extends Object
Entry point to fetch and register tree renderers. This API is meant to be integrated in tools that operate on tree descriptors generically. For that reason the standard descriptors provided by PMD and their properties are not public.- See Also:
findById(String)
,register(TreeRendererDescriptor)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TreeRendererDescriptor
findById(String id)
Returns the renderer descriptor registered by the given ID.static boolean
register(TreeRendererDescriptor descriptor)
Registers the given renderer.static Collection<TreeRendererDescriptor>
registeredRenderers()
Returns the set of renderers currently registered.
-
-
-
Method Detail
-
findById
public static TreeRendererDescriptor findById(String id)
Returns the renderer descriptor registered by the given ID. Returns null if not found, or the id is null.- Parameters:
id
- ID of the renderer to find- Returns:
- The descriptor, or null
-
registeredRenderers
public static Collection<TreeRendererDescriptor> registeredRenderers()
Returns the set of renderers currently registered. Order is undefined.
-
register
public static boolean register(TreeRendererDescriptor descriptor)
Registers the given renderer. If registration succeeds (the ID is not already associated to a descriptor), the descriptor will be available withfindById(String)
.- Parameters:
descriptor
- Descriptor to register- Returns:
- True if the registration succeeded, false if there was already a registered renderer with the given ID.
-
-