java_remove_imports - Man Page

remove import statements from Java source files

Synopsis

%java_remove_imports [list of file paths]... [-n <list of class names>...] [-p <list of patterns>...]

Description

This macro removes import statements from Java source files. The script matches all non-whitespace content following the import [static] statement against all patterns listed after the -p flag and all simple class names against names listed after the -n flag.

If the file path is a directory, recursively finds all Java source files inside. If not specified, runs in the current working directory.

-n

List of simple class names to be matched against the simple names of imported symbols. Names are matched for exact equality.

-p

List of patterns to be matched against imported symbols. The script uses the string.find function from Lua to match each imported symbol against every pattern.

Examples

Example of usage:

%java_remove_imports -n Nullable

Examples of patterns:

Author

Written by Marián Konček.

Reporting Bugs

Bugs should be reported through Java Packages Tools issue tracker at Github: https://github.com/fedora-java/javapackages/issues.

See Also

java_remove_annotations(7).

Referenced By

java_remove_annotations(7).

08/19/2022 JAVAPACKAGES Java Packages Tools