byNames
Filter by a name.
The name filter compares the symbol qualified name with the value in the filter:
filters {
excluded {
byNames.add("foo.Bar") // name filter, excludes class with name `foo.Bar` from dump
}
}
For Kotlin classes, the fully qualified names are used. It's important to keep in mind that periods .
are used everywhere as separators, even in the case of nested classes. For example, in the qualified name foo.bar.Container.Value
, Value
is a class nested inside Container
.
For Kotlin top-level function or properties in KLib, the fully qualified names are used. It's important to keep in mind that periods .
are used everywhere as separators, including separating package and function names. For example, foo.bar.myFunction
. There are no top-level methods in Java, they are all members of some class and the class name is still necessary to filter it out.
For classes from Java sources, canonical names are used. The main motivation is to ensure a consistent approach to writing class names, using periods .
as delimiters throughout.
Name templates are allowed, with support for wildcards such as **
, *
, and ?
:
**
- Matches zero or more characters, including periods.*
- Matches zero or more characters excluding periods. Use this to specify a single class name.?
- Matches exactly one character.
filters {
excluded {
byNames.add("**.My*") // A name filter that excludes classes in any non-root package with a name starting with `My`.
}
}