public abstract class OrderEnumerator
extends java.lang.Object
Interface for convenient processing dependencies of a module or a project. Allows to process OrderEntry
s
and collect classes and source roots.
Use orderEntries(Module)
or ModuleRootModel.orderEntries()
to process dependencies of a module
and use orderEntries(Project)
to process dependencies of all modules in a project.
Note that all configuration methods modify OrderEnumerator
instance instead of creating a new one.
Constructor and Description |
---|
OrderEnumerator() |
Modifier and Type | Method and Description |
---|---|
abstract OrderRootsEnumerator |
classes() |
abstract OrderEnumerator |
compileOnly()
Skip runtime-only dependencies
|
abstract OrderEnumerator |
exportedOnly()
Skip not exported dependencies.
|
abstract void |
forEach(Processor<? super OrderEntry> processor)
Runs
processor.process() for each entry processed by this enumerator. |
abstract void |
forEachLibrary(Processor<? super Library> processor)
Runs
processor.process() for each library processed by this enumerator. |
abstract void |
forEachModule(Processor<? super Module> processor)
Runs
processor.process() for each module processed by this enumerator. |
VirtualFile [] |
getAllLibrariesAndSdkClassesRoots() |
VirtualFile [] |
getAllSourceRoots() |
VirtualFile [] |
getClassesRoots() |
PathsList |
getPathsList() |
PathsList |
getSourcePathsList() |
VirtualFile [] |
getSourceRoots() |
OrderEnumerator |
librariesOnly() |
static OrderEnumerator |
orderEntries(Module module)
Creates new enumerator instance to process dependencies of
module |
static OrderEnumerator |
orderEntries(Project project)
Creates new enumerator instance to process dependencies of all modules in
project . |
abstract <R> R |
process(RootPolicy<R> policy,
R initialValue)
Passes order entries to the specified visitor.
|
abstract OrderEnumerator |
productionOnly()
Skip test dependencies
|
abstract OrderEnumerator |
recursively()
Recursively process modules on which the module depends.
|
abstract OrderRootsEnumerator |
roots(NotNullFunction<? super OrderEntry,? extends OrderRootType> rootTypeProvider) |
abstract OrderRootsEnumerator |
roots(OrderRootType rootType) |
abstract OrderEnumerator |
runtimeOnly()
Skip compile-only dependencies
|
abstract OrderEnumerator |
satisfying(Condition<? super OrderEntry> condition)
Process only entries which satisfies the specified condition
|
OrderEnumerator |
sdkOnly() |
abstract boolean |
shouldRecurse(ModuleOrderEntry entry,
java.util.List<? extends OrderEnumerationHandler> handlers)
Determine if, given the current enumerator settings and handlers for a module, should the
enumerator recurse to further modules based on the given ModuleOrderEntry?
|
abstract OrderRootsEnumerator |
sources() |
abstract OrderEnumerator |
using(RootModelProvider provider)
Use
provider.getRootModel() to process module dependencies |
abstract OrderEnumerator |
withoutDepModules() |
abstract OrderEnumerator |
withoutLibraries() |
abstract OrderEnumerator |
withoutModuleSourceEntries()
Skip root module's entries
|
abstract OrderEnumerator |
withoutSdk() |
public abstract OrderEnumerator productionOnly()
public abstract OrderEnumerator compileOnly()
public abstract OrderEnumerator runtimeOnly()
public abstract OrderEnumerator withoutSdk()
public abstract OrderEnumerator withoutLibraries()
public abstract OrderEnumerator withoutDepModules()
public abstract OrderEnumerator withoutModuleSourceEntries()
public OrderEnumerator librariesOnly()
public OrderEnumerator sdkOnly()
public VirtualFile [] getAllLibrariesAndSdkClassesRoots()
public VirtualFile [] getAllSourceRoots()
public abstract OrderEnumerator recursively()
public abstract OrderEnumerator exportedOnly()
recursively()
direct non-exported dependencies won't be skippedpublic abstract OrderEnumerator satisfying(Condition<? super OrderEntry> condition)
condition
- filtering conditionpublic abstract OrderEnumerator using(RootModelProvider provider)
provider.getRootModel()
to process module dependenciesprovider
- providerpublic abstract boolean shouldRecurse(ModuleOrderEntry entry, java.util.List<? extends OrderEnumerationHandler> handlers)
entry
- the ModuleOrderEntry in question (m1 -> m2)handlers
- custom handlers registered to the modulepublic abstract OrderRootsEnumerator classes()
OrderRootsEnumerator
instance for processing classes rootspublic abstract OrderRootsEnumerator sources()
OrderRootsEnumerator
instance for processing source rootspublic abstract OrderRootsEnumerator roots(OrderRootType rootType)
rootType
- root typeOrderRootsEnumerator
instance for processing roots of the specified typepublic abstract OrderRootsEnumerator roots(NotNullFunction<? super OrderEntry,? extends OrderRootType> rootTypeProvider)
rootTypeProvider
- custom root type providerOrderRootsEnumerator
instance for processing roots of the provided typepublic VirtualFile [] getClassesRoots()
public VirtualFile [] getSourceRoots()
public PathsList getPathsList()
public PathsList getSourcePathsList()
public abstract void forEach(Processor<? super OrderEntry> processor)
processor.process()
for each entry processed by this enumerator.processor
- processorpublic abstract void forEachLibrary(Processor<? super Library> processor)
processor.process()
for each library processed by this enumerator.processor
- processorpublic abstract void forEachModule(Processor<? super Module> processor)
processor.process()
for each module processed by this enumerator.processor
- processorpublic abstract <R> R process(RootPolicy<R> policy, R initialValue)
policy
- the visitor to accept.initialValue
- the default value to be returned by the visit process.OrderEntry.accept(RootPolicy, Object)
public static OrderEnumerator orderEntries(Module module)
module
module
- modulepublic static OrderEnumerator orderEntries(Project project)
project
. Only first level dependencies of
modules are processed so recursively()
option is ignored and withoutDepModules()
option is forcedproject
- project