com.intellij.openapi.roots
Interface ModuleRootModel

All Known Subinterfaces:
ModifiableRootModel
All Known Implementing Classes:
ModuleRootManager

public interface ModuleRootModel

Interface providing root information model for a given module.


Method Summary
 VirtualFile getCompilerOutputPath()
          Returns a compiler output path for production sources of the module, if it is valid.
 VirtualFile getCompilerOutputPathForTests()
          Returns a compiler output path for test sources of the module, if it is valid.
 java.lang.String getCompilerOutputPathForTestsUrl()
          Returns a compiler output path url for test sources of the module.
 java.lang.String getCompilerOutputPathUrl()
          Returns a compiler output path url for production sources of the 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.
 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.
 VirtualFile getExplodedDirectory()
          Returns an exploded directory path of the module, if it is valid.
 java.lang.String getExplodedDirectoryUrl()
          Returns an exploded directory path url.
 VirtualFile[] getJavadocPaths()
          Returns the list of javadoc roots for the module.
 java.lang.String[] getJavadocUrls()
          Returns the list of javadoc root URLs for the module.
 ProjectJdk getJdk()
          Returns the JDK used by the module.
 Module getModule()
          Returns the module to which the model belongs.
 OrderEntry[] getOrderEntries()
          Use this method to obtain order of roots of a module.
 VirtualFile[] getSourceRoots()
          Returns an array of source roots from all content entries.
 java.lang.String[] getSourceRootUrls()
          Returns an array of source root urls from all content entries.
 boolean isJdkInherited()
          Returns true if JDK for this module is inherited from a project.
<R> R
processOrder(RootPolicy<R> policy, R initialValue)
          Passes all order entries in the module to the specified visitor.
 

Method Detail

getModule

@NotNull
Module getModule()
Returns the module to which the model belongs.

Returns:
the module instance.

getContentEntries

ContentEntry[] getContentEntries()
Use this method to obtain all content entries of a module. Entries are given in lexicographical order of their paths.

Returns:
list of content entries for this module
See Also:
ContentEntry

getOrderEntries

OrderEntry[] getOrderEntries()
Use this method to obtain order of roots of a module. Order of entries is important.

Returns:
list of order entries for this module

getJdk

@Nullable
ProjectJdk getJdk()
Returns the JDK used by the module.

Returns:
either module-specific or inherited JDK
See Also:
isJdkInherited()

isJdkInherited

boolean isJdkInherited()
Returns true if JDK for this module is inherited from a project.

Returns:
true if the JDK is inherited, false otherwise
See Also:
ProjectRootManager.getProjectJdk(), ProjectRootManager.setProjectJdk(com.intellij.openapi.projectRoots.ProjectJdk)

getContentRoots

VirtualFile[] getContentRoots()
Returns an array of content roots from all content entries. A helper method.

Returns:
the array of content roots.
See Also:
getContentEntries()

getContentRootUrls

java.lang.String[] getContentRootUrls()
Returns an array of content root urls from all content entries. A helper method.

Returns:
the array of content root URLs.
See Also:
getContentEntries()

getExcludeRoots

VirtualFile[] getExcludeRoots()
Returns an array of exclude roots from all content entries. A helper method.

Returns:
the array of excluded roots.
See Also:
getContentEntries()

getExcludeRootUrls

java.lang.String[] getExcludeRootUrls()
Returns an array of exclude root urls from all content entries. A helper method.

Returns:
the array of excluded root URLs.
See Also:
getContentEntries()

getSourceRoots

VirtualFile[] getSourceRoots()
Returns an array of source roots from all content entries. A helper method.

Returns:
the array of source roots.
See Also:
getContentEntries()

getSourceRootUrls

java.lang.String[] getSourceRootUrls()
Returns an array of source root urls from all content entries. A helper method.

Returns:
the array of source root URLs.
See Also:
getContentEntries()

getCompilerOutputPath

@Nullable
VirtualFile getCompilerOutputPath()
Returns a compiler output path for production sources of the module, if it is valid.

Returns:
the compile output path, or null if one is not valid.

getCompilerOutputPathUrl

@Nullable
java.lang.String getCompilerOutputPathUrl()
Returns a compiler output path url for production sources of the module.

Returns:
the compiler output path URL, or null if it has never been set.

getCompilerOutputPathForTests

@Nullable
VirtualFile getCompilerOutputPathForTests()
Returns a compiler output path for test sources of the module, if it is valid.

Returns:
the compile output path for the test sources, or null if one is not valid.

getCompilerOutputPathForTestsUrl

java.lang.String getCompilerOutputPathForTestsUrl()
Returns a compiler output path url for test sources of the module.

Returns:
the compiler output path URL, or null if it has never been set.

getExplodedDirectory

@Nullable
VirtualFile getExplodedDirectory()
Returns an exploded directory path of the module, if it is valid.

Returns:
exploded directory path of the module, or null if not applicable or not set.

getExplodedDirectoryUrl

@Nullable
java.lang.String getExplodedDirectoryUrl()
Returns an exploded directory path url.

Returns:
exploded directory path url, or null if it has never been set or if not applicable for this module.

processOrder

<R> R processOrder(RootPolicy<R> policy,
                   R initialValue)
Passes all order entries in the module to the specified visitor.

Parameters:
policy - the visitor to accept.
initialValue - the default value to be returned by the visit process.
Returns:
the value returned by the visitor.
See Also:
OrderEntry.accept(RootPolicy, Object)

getDependencyModuleNames

java.lang.String[] getDependencyModuleNames()
Returns list of module names this module depends on.

Returns:
the list of module names this module depends on.

getJavadocPaths

VirtualFile[] getJavadocPaths()
Returns the list of javadoc roots for the module.

Returns:
the array of javadoc roots.

getJavadocUrls

java.lang.String[] getJavadocUrls()
Returns the list of javadoc root URLs for the module.

Returns:
the array of javadoc root URLs.