java_remove_imports - Man Page

remove import statements from Java source files

Synopsis

%java_remove_imports [optional flags] <matcher>... [file path]...

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 provided via the -p flag and all simple class names against names provided by the -n flag.

File path arguments are handled the following way:

Arguments can be specified in arbitrary order.

Matcher is one of:

-n <name>

Simple class name to be matched against the simple names of imported symbols. Names are matched for exact equality. Can be specified multiple times.

-p <pattern>

Regex patterns to be matched against imported symbols. Each imported symbol found in the code is matched against each pattern. Can be specified multiple times.

Optional flags:
-s, --strict

Fail if any of the user provided arguments were redundant.

Examples

Example of usage in a .spec file:

%java_remove_imports src -n Nullable

Examples of patterns:

Reporting Bugs

Bugs should be reported through the issue tracker at GitHub: https://github.com/fedora-java/jurand/issues.

Author

Written by Marián Konček.

See Also

java_remove_annotations(7).

Referenced By

java_remove_annotations(7).

2024-09-04 Jurand