public class CompilerModuleExtensionImpl extends CompilerModuleExtension
Disposable.Parent
PRODUCTION, TEST
EP_NAME
Constructor and Description |
---|
CompilerModuleExtensionImpl(Module module) |
Modifier and Type | Method and Description |
---|---|
void |
commit() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
VirtualFilePointer |
getCompilerOutputForTestsPointer() |
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.
|
VirtualFilePointer |
getCompilerOutputPointer() |
java.lang.String |
getCompilerOutputUrl()
Returns a compiler output path URL for production sources of the module.
|
java.lang.String |
getCompilerOutputUrlForTests()
Returns a compiler output path URL for test sources of the module.
|
CompilerModuleExtension |
getModifiableModel(boolean writable)
Note: don't call this method directly from client code.
|
Module |
getModule() |
VirtualFile [] |
getOutputRoots(boolean includeTests) |
java.lang.String [] |
getOutputRootUrls(boolean includeTests) |
Project |
getProject() |
void |
inheritCompilerOutputPath(boolean inherit)
Makes this module inheriting compiler output from its project
|
boolean |
isChanged() |
boolean |
isCompilerOutputPathInherited()
Returns
true if compiler output for this module is inherited from a project |
boolean |
isExcludeOutput() |
void |
readExternal(Element element) |
void |
setCompilerOutputPath(java.lang.String url) |
void |
setCompilerOutputPath(VirtualFile file) |
void |
setCompilerOutputPathForTests(java.lang.String url) |
void |
setCompilerOutputPathForTests(VirtualFile file) |
void |
setExcludeOutput(boolean exclude) |
void |
writeExternal(Element element) |
getInstance
public CompilerModuleExtensionImpl(Module module)
public void readExternal(Element element)
readExternal
in class ModuleExtension
public void writeExternal(Element element)
writeExternal
in class ModuleExtension
public VirtualFile getCompilerOutputPath()
CompilerModuleExtension
getCompilerOutputPath
in class CompilerModuleExtension
public VirtualFile getCompilerOutputPathForTests()
CompilerModuleExtension
getCompilerOutputPathForTests
in class CompilerModuleExtension
public java.lang.String getCompilerOutputUrl()
CompilerModuleExtension
getCompilerOutputUrl
in class CompilerModuleExtension
public java.lang.String getCompilerOutputUrlForTests()
CompilerModuleExtension
getCompilerOutputUrlForTests
in class CompilerModuleExtension
public void setCompilerOutputPath(VirtualFile file)
setCompilerOutputPath
in class CompilerModuleExtension
public void setCompilerOutputPath(java.lang.String url)
setCompilerOutputPath
in class CompilerModuleExtension
public void setCompilerOutputPathForTests(VirtualFile file)
setCompilerOutputPathForTests
in class CompilerModuleExtension
public void setCompilerOutputPathForTests(java.lang.String url)
setCompilerOutputPathForTests
in class CompilerModuleExtension
public Module getModule()
public Project getProject()
public void inheritCompilerOutputPath(boolean inherit)
CompilerModuleExtension
inheritCompilerOutputPath
in class CompilerModuleExtension
inherit
- whether or not compiler output is inheritedpublic boolean isCompilerOutputPathInherited()
CompilerModuleExtension
true
if compiler output for this module is inherited from a projectisCompilerOutputPathInherited
in class CompilerModuleExtension
public VirtualFilePointer getCompilerOutputPointer()
getCompilerOutputPointer
in class CompilerModuleExtension
public VirtualFilePointer getCompilerOutputForTestsPointer()
getCompilerOutputForTestsPointer
in class CompilerModuleExtension
public void setExcludeOutput(boolean exclude)
setExcludeOutput
in class CompilerModuleExtension
public boolean isExcludeOutput()
isExcludeOutput
in class CompilerModuleExtension
public CompilerModuleExtension getModifiableModel(boolean writable)
ModuleExtension
ModifiableRootModel modifiableModel = ModuleRootManager.getInstance(module).getModifiableModel(); CompilerModuleExtension extension = modifiableModel.getModuleExtension(CompilerModuleExtension.class); try { // ... } finally { modifiableModel.commit(); }The point is that call to commit() on CompilerModuleExtension obtained like
'CompilerModuleExtension.getInstance(module).getModifiableModel(true)'
doesn't dispose the model.
Call to ModifiableRootModel.commit()
not only commits linked extensions but disposes them as well.getModifiableModel
in class ModuleExtension
writable
- flag which identifies if resulting model is writablepublic void commit()
commit
in class ModuleExtension
public boolean isChanged()
isChanged
in class ModuleExtension
public void dispose()
Disposable
public VirtualFile [] getOutputRoots(boolean includeTests)
getOutputRoots
in class CompilerModuleExtension
public java.lang.String [] getOutputRootUrls(boolean includeTests)
getOutputRootUrls
in class CompilerModuleExtension