Package com.puppycrawl.tools.checkstyle
Interface ModuleFactory
-
- All Known Implementing Classes:
PackageObjectFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ModuleFactory
A module factory creates Objects from a given name. Its purpose is to map the short names likeAvoidStarImport
to full class names likecom.puppycrawl.tools.checkstyle.checks.AvoidStarImportCheck
. A ModuleFactory can implement this name resolution by using naming conventions, fallback strategies, etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
createModule(String name)
Creates a new instance of a class from a given name.
-
-
-
Method Detail
-
createModule
Object createModule(String name) throws CheckstyleException
Creates a new instance of a class from a given name. If the provided module name is a class name an instance of that class is returned. If the name is not a class name the ModuleFactory uses heuristics to find the corresponding class.- Parameters:
name
- the name of the module, might be a short name- Returns:
- the created module
- Throws:
CheckstyleException
- if no module can be instantiated from name
-
-