public class ModulesOrderEnumerator extends OrderEnumerator
Modifier and Type | Class and Description |
---|---|
protected static class |
OrderEnumeratorBase.ProcessEntryAction |
protected static class |
OrderEnumeratorBase.ProcessEntryActionType |
Constructor and Description |
---|
ModulesOrderEnumerator(java.util.Collection<? extends Module> modules) |
Modifier and Type | Method and Description |
---|---|
OrderRootsEnumerator |
classes() |
OrderEnumerator |
compileOnly()
Skip runtime-only dependencies
|
OrderEnumerator |
exportedOnly()
Skip not exported dependencies.
|
protected void |
forEach(PairProcessor<? super OrderEntry,? super java.util.List<? extends OrderEnumerationHandler>> processor) |
void |
forEach(Processor<? super OrderEntry> processor)
Runs
processor.process() for each entry processed by this enumerator. |
void |
forEachLibrary(Processor<? super Library> processor)
Runs
processor.process() for each library processed by this enumerator. |
void |
forEachModule(Processor<? super Module> processor)
Runs
processor.process() for each module processed by this enumerator. |
int |
getFlags() |
boolean |
isCompileOnly() |
boolean |
isProductionOnly() |
boolean |
isRootModuleModel(ModuleRootModel rootModel) |
boolean |
isRuntimeOnly() |
<R> R |
process(RootPolicy<R> policy,
R initialValue)
Passes order entries to the specified visitor.
|
protected void |
processEntries(ModuleRootModel rootModel,
java.util.Set<? super Module> processed,
boolean firstLevel,
java.util.List<? extends OrderEnumerationHandler> customHandlers,
PairProcessor<? super OrderEntry,? super java.util.List<? extends OrderEnumerationHandler>> processor) |
void |
processRootModules(Processor<? super Module> processor)
Runs processor on each module that this enumerator was created on.
|
OrderEnumerator |
productionOnly()
Skip test dependencies
|
OrderEnumerator |
recursively()
Recursively process modules on which the module depends.
|
OrderRootsEnumerator |
roots(NotNullFunction<? super OrderEntry,? extends OrderRootType> rootTypeProvider) |
OrderRootsEnumerator |
roots(OrderRootType rootType) |
OrderEnumerator |
runtimeOnly()
Skip compile-only dependencies
|
OrderEnumerator |
satisfying(Condition<? super OrderEntry> condition)
Process only entries which satisfies the specified condition
|
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?
|
OrderRootsEnumerator |
sources() |
OrderEnumerator |
using(RootModelProvider provider)
Use
provider.getRootModel() to process module dependencies |
OrderEnumerator |
withoutDepModules() |
OrderEnumerator |
withoutLibraries() |
OrderEnumerator |
withoutModuleSourceEntries()
Skip root module's entries
|
OrderEnumerator |
withoutSdk() |
getAllLibrariesAndSdkClassesRoots, getAllSourceRoots, getClassesRoots, getPathsList, getSourcePathsList, getSourceRoots, librariesOnly, orderEntries, orderEntries, sdkOnly
public ModulesOrderEnumerator(java.util.Collection<? extends Module> modules)
public void processRootModules(Processor<? super Module> processor)
processor
- processorprotected void forEach(PairProcessor<? super OrderEntry,? super java.util.List<? extends OrderEnumerationHandler>> processor)
public boolean isRootModuleModel(ModuleRootModel rootModel)
public OrderEnumerator productionOnly()
OrderEnumerator
productionOnly
in class OrderEnumerator
public OrderEnumerator compileOnly()
OrderEnumerator
compileOnly
in class OrderEnumerator
public OrderEnumerator runtimeOnly()
OrderEnumerator
runtimeOnly
in class OrderEnumerator
public OrderEnumerator withoutSdk()
withoutSdk
in class OrderEnumerator
public OrderEnumerator withoutLibraries()
withoutLibraries
in class OrderEnumerator
public OrderEnumerator withoutDepModules()
withoutDepModules
in class OrderEnumerator
public OrderEnumerator withoutModuleSourceEntries()
OrderEnumerator
withoutModuleSourceEntries
in class OrderEnumerator
public OrderEnumerator recursively()
OrderEnumerator
recursively
in class OrderEnumerator
public OrderEnumerator exportedOnly()
OrderEnumerator
OrderEnumerator.recursively()
direct non-exported dependencies won't be skippedexportedOnly
in class OrderEnumerator
public OrderEnumerator satisfying(Condition<? super OrderEntry> condition)
OrderEnumerator
satisfying
in class OrderEnumerator
condition
- filtering conditionpublic OrderEnumerator using(RootModelProvider provider)
OrderEnumerator
provider.getRootModel()
to process module dependenciesusing
in class OrderEnumerator
provider
- providerpublic OrderRootsEnumerator classes()
classes
in class OrderEnumerator
OrderRootsEnumerator
instance for processing classes rootspublic OrderRootsEnumerator sources()
sources
in class OrderEnumerator
OrderRootsEnumerator
instance for processing source rootspublic OrderRootsEnumerator roots(OrderRootType rootType)
roots
in class OrderEnumerator
rootType
- root typeOrderRootsEnumerator
instance for processing roots of the specified typepublic OrderRootsEnumerator roots(NotNullFunction<? super OrderEntry,? extends OrderRootType> rootTypeProvider)
roots
in class OrderEnumerator
rootTypeProvider
- custom root type providerOrderRootsEnumerator
instance for processing roots of the provided typepublic int getFlags()
public boolean shouldRecurse(ModuleOrderEntry entry, java.util.List<? extends OrderEnumerationHandler> handlers)
OrderEnumerator
shouldRecurse
in class OrderEnumerator
entry
- the ModuleOrderEntry in question (m1 -> m2)handlers
- custom handlers registered to the moduleprotected void processEntries(ModuleRootModel rootModel, java.util.Set<? super Module> processed, boolean firstLevel, java.util.List<? extends OrderEnumerationHandler> customHandlers, PairProcessor<? super OrderEntry,? super java.util.List<? extends OrderEnumerationHandler>> processor)
public void forEach(Processor<? super OrderEntry> processor)
OrderEnumerator
processor.process()
for each entry processed by this enumerator.forEach
in class OrderEnumerator
processor
- processorpublic void forEachLibrary(Processor<? super Library> processor)
OrderEnumerator
processor.process()
for each library processed by this enumerator.forEachLibrary
in class OrderEnumerator
processor
- processorpublic void forEachModule(Processor<? super Module> processor)
OrderEnumerator
processor.process()
for each module processed by this enumerator.forEachModule
in class OrderEnumerator
processor
- processorpublic <R> R process(RootPolicy<R> policy, R initialValue)
OrderEnumerator
process
in class OrderEnumerator
policy
- the visitor to accept.initialValue
- the default value to be returned by the visit process.OrderEntry.accept(RootPolicy, Object)
public boolean isRuntimeOnly()
isRuntimeOnly
in interface OrderEnumeratorSettings
public boolean isCompileOnly()
isCompileOnly
in interface OrderEnumeratorSettings
public boolean isProductionOnly()
isProductionOnly
in interface OrderEnumeratorSettings