Class KotlinGroovyLanguageSupport
- java.lang.Object
-
- de.skuzzle.enforcer.restrictimports.parser.lang.KotlinGroovyLanguageSupport
-
- All Implemented Interfaces:
LanguageSupport
public class KotlinGroovyLanguageSupport extends Object implements LanguageSupport
-
-
Constructor Summary
Constructors Constructor Description KotlinGroovyLanguageSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getSupportedFileExtensions()The set of supported file extensions.List<ImportStatement>parseImport(String line, int lineNumber)Extract the package names that this import statement represents.Optional<String>parsePackage(String line)Parses the given line and returns the declared package-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.skuzzle.enforcer.restrictimports.parser.lang.LanguageSupport
parseCompilationUnit, parseFullCompilationUnitSupported
-
-
-
-
Method Detail
-
getSupportedFileExtensions
public Set<String> getSupportedFileExtensions()
Description copied from interface:LanguageSupportThe set of supported file extensions. Extensions returned here are case insensitive and may or may not start with a '.' (dot).- Specified by:
getSupportedFileExtensionsin interfaceLanguageSupport- Returns:
- The set of file extensions.
-
parsePackage
public Optional<String> parsePackage(String line)
Description copied from interface:LanguageSupportParses the given line and returns the declared package- Specified by:
parsePackagein interfaceLanguageSupport- Parameters:
line- Line in the source file- Returns:
- The package declared
-
parseImport
public List<ImportStatement> parseImport(String line, int lineNumber)
Description copied from interface:LanguageSupportExtract the package names that this import statement represents. As some languages allow to specify multiple imports in a single line, this method returns a list.e.g. import java.util.List; The above should return java.util.List in a Java source file.
- Specified by:
parseImportin interfaceLanguageSupport- Parameters:
line- Line in the source filelineNumber- The line number of the import.- Returns:
- Fully qualified package name that this import represents
-
-