public class ModuleRootManagerImpl extends ModuleRootManagerEx implements Disposable
| Modifier and Type | Class and Description |
|---|---|
static class |
ModuleRootManagerImpl.ModuleRootManagerState |
Disposable.Parent| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
LOG |
protected SimpleModificationTracker |
myModificationTracker |
protected RootModelImpl |
myRootModel |
| Constructor and Description |
|---|
ModuleRootManagerImpl(Module module) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
dropCaches() |
static OrderRootsEnumerator |
getCachingEnumeratorForType(OrderRootType type,
Module module) |
ContentEntry [] |
getContentEntries()
Use this method to obtain all content entries of a module.
|
VirtualFile [] |
getContentRoots()
Returns an array of content roots from all content entries.
|
java.lang.String [] |
getContentRootUrls()
Returns an array of content root urls from all content entries.
|
Module [] |
getDependencies()
Returns the list of modules on which the current module directly depends.
|
Module [] |
getDependencies(boolean includeTests)
Returns the list of modules on which the current module directly depends.
|
java.lang.String [] |
getDependencyModuleNames()
Returns list of module names this module depends on.
|
VirtualFile [] |
getExcludeRoots()
Returns an array of exclude roots from all content entries.
|
java.lang.String [] |
getExcludeRootUrls()
Returns an array of exclude root urls from all content entries.
|
ProjectModelExternalSource |
getExternalSource()
Return non-null value if this element was automatically created by the IDE during importing from some external project system rather
than created by user manually via UI.
|
ModuleFileIndex |
getFileIndex()
Returns the file index for the current module.
|
ModifiableRootModel |
getModifiableModel()
Returns the interface for modifying the set of roots for this module.
|
ModifiableRootModel |
getModifiableModel(RootConfigurationAccessor accessor) |
long |
getModificationCountForTests() |
Module |
getModule()
Returns the module to which the model belongs.
|
Module [] |
getModuleDependencies() |
Module [] |
getModuleDependencies(boolean includeTests) |
<T> T |
getModuleExtension(java.lang.Class<T> klass) |
OrderEntry [] |
getOrderEntries()
Use this method to obtain order of roots of a module.
|
RootModelImpl |
getRootModel() |
Sdk |
getSdk()
Returns the SDK used by the module.
|
VirtualFile [] |
getSourceRoots()
Returns an array of source roots from all content entries.
|
VirtualFile [] |
getSourceRoots(boolean includingTests)
Returns an array of source roots from all content entries.
|
java.util.List<VirtualFile> |
getSourceRoots(JpsModuleSourceRootType<?> rootType)
Return a list of source roots of the specified type.
|
java.util.List<VirtualFile> |
getSourceRoots(java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes)
Return a list of source roots which types belong to the specified set.
|
java.lang.String [] |
getSourceRootUrls()
Returns an array of source root urls from all content entries.
|
java.lang.String [] |
getSourceRootUrls(boolean includingTests)
Returns an array of source root urls from all content entries.
|
ModuleRootManagerImpl.ModuleRootManagerState |
getState() |
boolean |
isDependsOn(Module module)
Checks if the current module directly depends on the specified module.
|
boolean |
isSdkInherited()
Returns
true if SDK for this module is inherited from a project. |
void |
loadState(ModuleRootManagerImpl.ModuleRootManagerState object) |
protected void |
loadState(ModuleRootManagerImpl.ModuleRootManagerState object,
boolean throwEvent) |
OrderEnumerator |
orderEntries()
Returns
OrderEnumerator instance which can be used to process order entries of the module (with or without dependencies) and
collect classes or source roots. |
<R> R |
processOrder(RootPolicy<R> policy,
R initialValue)
Passes all order entries in the module to the specified visitor.
|
void |
stateChanged() |
getInstanceExgetInstanceprotected static final Logger LOG
protected RootModelImpl myRootModel
protected final SimpleModificationTracker myModificationTracker
public ModuleRootManagerImpl(Module module)
public Module getModule()
ModuleRootModelgetModule in interface ModuleRootModelpublic ModuleFileIndex getFileIndex()
ModuleRootManagergetFileIndex in class ModuleRootManagerpublic void dispose()
Disposabledispose in interface Disposablepublic ModifiableRootModel getModifiableModel()
ModuleRootManagerModifiableRootModel.commit() or disposed ModifiableRootModel.dispose()getModifiableModel in class ModuleRootManagerpublic ModifiableRootModel getModifiableModel(RootConfigurationAccessor accessor)
getModifiableModel in class ModuleRootManagerExpublic long getModificationCountForTests()
getModificationCountForTests in class ModuleRootManagerExpublic RootModelImpl getRootModel()
public ContentEntry [] getContentEntries()
ModuleRootModelgetContentEntries in interface ModuleRootModelContentEntrypublic OrderEntry [] getOrderEntries()
ModuleRootModelgetOrderEntries in interface ModuleRootModelpublic Sdk getSdk()
ModuleRootModelgetSdk in interface ModuleRootModelModuleRootModel.isSdkInherited()public boolean isSdkInherited()
ModuleRootModeltrue if SDK for this module is inherited from a project.isSdkInherited in interface ModuleRootModelProjectRootManager.getProjectSdk(),
ProjectRootManager.setProjectSdk(Sdk)public Module [] getDependencies()
ModuleRootManagergetDependencies in class ModuleRootManagerpublic Module [] getDependencies(boolean includeTests)
ModuleRootManagergetDependencies in class ModuleRootManagerincludeTests - whether test-only dependencies should be includedpublic Module [] getModuleDependencies()
getModuleDependencies in interface ModuleRootModelpublic Module [] getModuleDependencies(boolean includeTests)
getModuleDependencies in interface ModuleRootModelpublic boolean isDependsOn(Module module)
ModuleRootManagerisDependsOn in class ModuleRootManagermodule - the module to check.module is contained in the list of dependencies for the current module, false otherwise.public java.lang.String [] getDependencyModuleNames()
ModuleRootModelgetDependencyModuleNames in interface ModuleRootModelpublic <T> T getModuleExtension(java.lang.Class<T> klass)
getModuleExtension in interface ModuleRootModelpublic <R> R processOrder(RootPolicy<R> policy, R initialValue)
ModuleRootModelprocessOrder in interface ModuleRootModelpolicy - the visitor to accept.initialValue - the default value to be returned by the visit process.OrderEntry.accept(RootPolicy, Object)public OrderEnumerator orderEntries()
ModuleRootModelOrderEnumerator instance which can be used to process order entries of the module (with or without dependencies) and
collect classes or source roots.orderEntries in interface ModuleRootModelOrderEnumerator instancepublic static OrderRootsEnumerator getCachingEnumeratorForType(OrderRootType type, Module module)
public VirtualFile [] getContentRoots()
ModuleRootModelgetContentRoots in interface ModuleRootModelModuleRootModel.getContentEntries()public java.lang.String [] getContentRootUrls()
ModuleRootModelgetContentRootUrls in interface ModuleRootModelModuleRootModel.getContentEntries()public java.lang.String [] getExcludeRootUrls()
ModuleRootModelgetExcludeRootUrls in interface ModuleRootModelModuleRootModel.getContentEntries()public VirtualFile [] getExcludeRoots()
ModuleRootModelgetExcludeRoots in interface ModuleRootModelModuleRootModel.getContentEntries()public java.lang.String [] getSourceRootUrls()
ModuleRootModelgetSourceRootUrls in interface ModuleRootModelModuleRootModel.getContentEntries(),
ModuleRootModel.getSourceRootUrls(boolean)public java.lang.String [] getSourceRootUrls(boolean includingTests)
ModuleRootModelgetSourceRootUrls in interface ModuleRootModelincludingTests - determines whether test source root urls should be included in the resultModuleRootModel.getContentEntries()public VirtualFile [] getSourceRoots()
ModuleRootModelgetSourceRoots in interface ModuleRootModelModuleRootModel.getContentEntries(),
ModuleRootModel.getSourceRoots(boolean)public VirtualFile [] getSourceRoots(boolean includingTests)
ModuleRootModelgetSourceRoots in interface ModuleRootModelincludingTests - determines whether test source roots should be included in the resultModuleRootModel.getContentEntries()public java.util.List<VirtualFile> getSourceRoots(JpsModuleSourceRootType<?> rootType)
ModuleRootModelgetSourceRoots in interface ModuleRootModelrootType - type of source rootspublic java.util.List<VirtualFile> getSourceRoots(java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes)
ModuleRootModelgetSourceRoots in interface ModuleRootModelrootTypes - types of source rootspublic void dropCaches()
dropCaches in class ModuleRootManagerExpublic ModuleRootManagerImpl.ModuleRootManagerState getState()
public void loadState(ModuleRootManagerImpl.ModuleRootManagerState object)
protected void loadState(ModuleRootManagerImpl.ModuleRootManagerState object, boolean throwEvent)
public void stateChanged()
public ProjectModelExternalSource getExternalSource()
ProjectModelElementgetExternalSource in interface ProjectModelElement