|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PsiDirectory
Represents a file system directory and allows to access its contents.
| Field Summary | |
|---|---|
static PsiDirectory[] |
EMPTY_ARRAY
The empty array of PSI directories which can be reused to avoid unnecessary allocations. |
| Method Summary | |
|---|---|
void |
checkCreateClass(java.lang.String name)
Checks if it's possible to create a class with the specified name in the directory, and throws an exception if the creation is not possible. |
void |
checkCreateFile(java.lang.String name)
Checks if it's possible to create a file with the specified name in the directory, and throws an exception if the creation is not possible. |
void |
checkCreateInterface(java.lang.String name)
Checks if it's possible to create an interface with the specified name in the directory, and throws an exception if the creation is not possible. |
void |
checkCreateSubdirectory(java.lang.String name)
Checks if it's possible to create a subdirectory with the specified name in the directory, and throws an exception if the creation is not possible. |
PsiClass |
createAnnotationType(java.lang.String name)
Creates an annotation class with the specified name in the directory. |
PsiClass |
createClass(java.lang.String name)
Creates a class with the specified name in the directory. |
PsiClass |
createEnum(java.lang.String name)
Creates an enumeration class with the specified name in the directory. |
PsiFile |
createFile(java.lang.String name)
Creates a file with the specified name in the directory. |
PsiClass |
createInterface(java.lang.String name)
Creates an interface class with the specified name in the directory. |
PsiDirectory |
createSubdirectory(java.lang.String name)
Creates a subdirectory with the specified name in the directory. |
PsiFile |
findFile(java.lang.String name)
Finds a file with the specified name in this directory. |
PsiDirectory |
findSubdirectory(java.lang.String name)
Finds the subdirectory of this directory with the specified name. |
PsiClass[] |
getClasses()
Returns the list of Java classes contained in the directory. |
PsiFile[] |
getFiles()
Returns the list of files in the directory. |
java.lang.String |
getName()
Returns the name of the element. |
PsiPackage |
getPackage()
Returns the package corresponding to the directory. |
PsiDirectory |
getParentDirectory()
Returns the parent directory of the directory. |
PsiDirectory[] |
getSubdirectories()
Returns the list of subdirectories of this directory. |
VirtualFile |
getVirtualFile()
Returns the virtual file represented by the PSI directory. |
boolean |
isSourceRoot()
Checks if the directory is a source root for the project to which it belongs. |
PsiElement |
setName(java.lang.String name)
Renames the element. |
| Methods inherited from interface com.intellij.psi.PsiFileSystemItem |
|---|
checkSetName |
| Methods inherited from interface com.intellij.navigation.NavigationItem |
|---|
getFileStatus, getPresentation |
| Methods inherited from interface com.intellij.pom.Navigatable |
|---|
canNavigate, canNavigateToSource, navigate |
| Field Detail |
|---|
static final PsiDirectory[] EMPTY_ARRAY
| Method Detail |
|---|
@NotNull VirtualFile getVirtualFile()
java.lang.String getName()
PsiNamedElement
getName in interface NavigationItemgetName in interface PsiNamedElement
@NotNull
PsiElement setName(java.lang.String name)
throws IncorrectOperationException
PsiNamedElement
setName in interface PsiNamedElementname - the new element name.
this
or a different element if the rename caused the element to be replaced).
IncorrectOperationException - if the modification is not supported or not possible for some reason.@Nullable PsiPackage getPackage()
@Nullable PsiDirectory getParentDirectory()
@NotNull PsiDirectory[] getSubdirectories()
@NotNull PsiFile[] getFiles()
@NotNull PsiClass[] getClasses()
@Nullable PsiDirectory findSubdirectory(java.lang.String name)
name - the name of the subdirectory to find.
@Nullable PsiFile findFile(java.lang.String name)
name - the name of the file to find.
@NotNull
PsiClass createClass(java.lang.String name)
throws IncorrectOperationException
name - the name of the class to create (not including the file extension).
IncorrectOperationException - if the operation failed for some reason.
void checkCreateClass(java.lang.String name)
throws IncorrectOperationException
name - the name of the class to check creation possibility (not including the file extension).
IncorrectOperationException - if the creation is not possible.
@NotNull
PsiClass createInterface(java.lang.String name)
throws IncorrectOperationException
name - the name of the interface to create (not including the file extension).
IncorrectOperationException - if the operation failed for some reason.
void checkCreateInterface(java.lang.String name)
throws IncorrectOperationException
name - the name of the interface to check creation possibility (not including the file extension).
IncorrectOperationException - if the creation is not possible.
@NotNull
PsiClass createEnum(java.lang.String name)
throws IncorrectOperationException
name - the name of the enumeration class to create (not including the file extension).
IncorrectOperationException - if the operation failed for some reason.
@NotNull
PsiClass createAnnotationType(java.lang.String name)
throws IncorrectOperationException
name - the name of the annotation class to create (not including the file extension).
IncorrectOperationException - if the operation failed for some reason.
@NotNull
PsiDirectory createSubdirectory(java.lang.String name)
throws IncorrectOperationException
name - the name of the subdirectory to create.
IncorrectOperationException - if the operation failed for some reason.
void checkCreateSubdirectory(java.lang.String name)
throws IncorrectOperationException
name - the name of the subdirectory to check creation possibility.
IncorrectOperationException - if the creation is not possible.
@NotNull
PsiFile createFile(java.lang.String name)
throws IncorrectOperationException
name - the name of the file to create.
IncorrectOperationException - if the operation failed for some reason.
void checkCreateFile(java.lang.String name)
throws IncorrectOperationException
name - the name of the file to check creation possibility.
IncorrectOperationException - if the creation is not possible.boolean isSourceRoot()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||