public class ContentEntryImpl extends java.lang.Object implements ContentEntry, java.lang.Comparable<ContentEntryImpl>
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT_NAME |
static java.lang.String |
URL_ATTRIBUTE |
Modifier and Type | Method and Description |
---|---|
ExcludeFolder |
addExcludeFolder(java.lang.String url)
Adds an exclude root under the content root.
|
ExcludeFolder |
addExcludeFolder(VirtualFile file)
Adds an exclude root under the content root.
|
void |
addExcludePattern(java.lang.String pattern) |
SourceFolder |
addSourceFolder(java.lang.String url,
boolean isTestSource)
Adds a source or test source root under the content root.
|
<P extends JpsElement> |
addSourceFolder(java.lang.String url,
JpsModuleSourceRootType<P> type) |
<P extends JpsElement> |
addSourceFolder(java.lang.String url,
JpsModuleSourceRootType<P> type,
P properties) |
SourceFolder |
addSourceFolder(VirtualFile file,
boolean isTestSource)
Adds a source or test source root under the content root.
|
SourceFolder |
addSourceFolder(VirtualFile file,
boolean isTestSource,
java.lang.String packagePrefix)
Adds a source or test source root with the specified package prefix under the content root.
|
<P extends JpsElement> |
addSourceFolder(VirtualFile file,
JpsModuleSourceRootType<P> type) |
<P extends JpsElement> |
addSourceFolder(VirtualFile file,
JpsModuleSourceRootType<P> type,
P properties) |
void |
clearExcludeFolders() |
void |
clearSourceFolders() |
ContentEntry |
cloneEntry(RootModelImpl rootModel) |
int |
compareTo(ContentEntryImpl other) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
VirtualFile [] |
getExcludeFolderFiles()
Returns the list of files and directories for valid excluded roots under this content root.
|
ExcludeFolder [] |
getExcludeFolders()
Returns the list of excluded roots configured under this content root.
|
java.util.List<java.lang.String> |
getExcludeFolderUrls() |
java.util.List<java.lang.String> |
getExcludePatterns()
Returns patterns for names of files which should be excluded from this content root.
|
VirtualFile |
getFile()
Returns the root file or directory for the content root, if it is valid.
|
RootModelImpl |
getRootModel() |
VirtualFile [] |
getSourceFolderFiles()
Returns the list of files and directories for valid source roots under this content root.
|
SourceFolder [] |
getSourceFolders()
Returns the list of source roots under this content root.
|
java.util.List<SourceFolder> |
getSourceFolders(JpsModuleSourceRootType<?> rootType) |
java.util.List<SourceFolder> |
getSourceFolders(java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes) |
java.lang.String |
getUrl()
Returns the URL of content root.
|
boolean |
isDisposed() |
boolean |
isSynthetic() |
void |
removeExcludeFolder(ExcludeFolder excludeFolder)
Removes an exclude root from this content root.
|
boolean |
removeExcludeFolder(java.lang.String url)
Removes an exclude root from this content root.
|
void |
removeExcludePattern(java.lang.String pattern) |
void |
removeSourceFolder(SourceFolder sourceFolder)
Removes a source or test source root from this content root.
|
void |
setExcludePatterns(java.util.List<java.lang.String> patterns) |
void |
writeExternal(Element element) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRootModel
public static final java.lang.String ELEMENT_NAME
public static final java.lang.String URL_ATTRIBUTE
public VirtualFile getFile()
ContentEntry
getFile
in interface ContentEntry
public java.lang.String getUrl()
ContentEntry
VirtualFileManager.findFileByUrl(String)
getUrl
in interface ContentEntry
public SourceFolder [] getSourceFolders()
ContentEntry
getSourceFolders
in interface ContentEntry
ContentEntry
SourceFolder
spublic java.util.List<SourceFolder> getSourceFolders(JpsModuleSourceRootType<?> rootType)
getSourceFolders
in interface ContentEntry
rootType
- type of accepted source rootspublic java.util.List<SourceFolder> getSourceFolders(java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes)
getSourceFolders
in interface ContentEntry
rootTypes
- types of accepted source rootspublic VirtualFile [] getSourceFolderFiles()
ContentEntry
getSourceFolderFiles
in interface ContentEntry
public ExcludeFolder [] getExcludeFolders()
ContentEntry
getExcludeFolders
in interface ContentEntry
ContentEntry
ExcludeFolder
spublic java.util.List<java.lang.String> getExcludeFolderUrls()
getExcludeFolderUrls
in interface ContentEntry
public VirtualFile [] getExcludeFolderFiles()
ContentEntry
getExcludeFolderFiles
in interface ContentEntry
public SourceFolder addSourceFolder(VirtualFile file, boolean isTestSource)
ContentEntry
addSourceFolder
in interface ContentEntry
file
- the file or directory to add as a source root.isTestSource
- true if the file or directory is added as a test source root.public SourceFolder addSourceFolder(VirtualFile file, boolean isTestSource, java.lang.String packagePrefix)
ContentEntry
addSourceFolder
in interface ContentEntry
file
- the file or directory to add as a source root.isTestSource
- true if the file or directory is added as a test source root.packagePrefix
- the package prefix for the root to add, or an empty string if no
package prefix is required.public <P extends JpsElement> SourceFolder addSourceFolder(VirtualFile file, JpsModuleSourceRootType<P> type, P properties)
addSourceFolder
in interface ContentEntry
public <P extends JpsElement> SourceFolder addSourceFolder(VirtualFile file, JpsModuleSourceRootType<P> type)
addSourceFolder
in interface ContentEntry
public SourceFolder addSourceFolder(java.lang.String url, boolean isTestSource)
ContentEntry
addSourceFolder
in interface ContentEntry
url
- the file or directory url to add as a source root.isTestSource
- true if the file or directory is added as a test source root.public <P extends JpsElement> SourceFolder addSourceFolder(java.lang.String url, JpsModuleSourceRootType<P> type)
addSourceFolder
in interface ContentEntry
public <P extends JpsElement> SourceFolder addSourceFolder(java.lang.String url, JpsModuleSourceRootType<P> type, P properties)
addSourceFolder
in interface ContentEntry
public void removeSourceFolder(SourceFolder sourceFolder)
ContentEntry
removeSourceFolder
in interface ContentEntry
sourceFolder
- the source root to remove (must belong to this content root).public void clearSourceFolders()
clearSourceFolders
in interface ContentEntry
public ExcludeFolder addExcludeFolder(VirtualFile file)
ContentEntry
addExcludeFolder
in interface ContentEntry
file
- the file or directory to add as an exclude root.public ExcludeFolder addExcludeFolder(java.lang.String url)
ContentEntry
addExcludeFolder
in interface ContentEntry
url
- the file or directory url to add as an exclude root.public void removeExcludeFolder(ExcludeFolder excludeFolder)
ContentEntry
removeExcludeFolder
in interface ContentEntry
excludeFolder
- the exclude root to remove (must belong to this content root).public boolean removeExcludeFolder(java.lang.String url)
ContentEntry
removeExcludeFolder
in interface ContentEntry
url
- url of the exclude roottrue
if the exclude root was removedpublic void clearExcludeFolders()
clearExcludeFolders
in interface ContentEntry
public java.util.List<java.lang.String> getExcludePatterns()
ContentEntry
getExcludePatterns
in interface ContentEntry
public void addExcludePattern(java.lang.String pattern)
addExcludePattern
in interface ContentEntry
public void removeExcludePattern(java.lang.String pattern)
removeExcludePattern
in interface ContentEntry
public void setExcludePatterns(java.util.List<java.lang.String> patterns)
setExcludePatterns
in interface ContentEntry
public boolean isSynthetic()
isSynthetic
in interface Synthetic
public ContentEntry cloneEntry(RootModelImpl rootModel)
public void writeExternal(Element element) throws WriteExternalException
WriteExternalException
public int compareTo(ContentEntryImpl other)
compareTo
in interface java.lang.Comparable<ContentEntryImpl>
public RootModelImpl getRootModel()
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()