public abstract class JavaDirectoryService
extends java.lang.Object
Constructor and Description |
---|
JavaDirectoryService() |
Modifier and Type | Method and Description |
---|---|
abstract void |
checkCreateClass(PsiDirectory dir,
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.
|
abstract PsiClass |
createAnnotationType(PsiDirectory dir,
java.lang.String name)
Creates an annotation class with the specified name in the directory.
|
abstract PsiClass |
createClass(PsiDirectory dir,
java.lang.String name)
Creates a class with the specified name in the directory.
|
abstract PsiClass |
createClass(PsiDirectory dir,
java.lang.String name,
java.lang.String templateName)
Creates a class with the specified name in the directory.
|
abstract PsiClass |
createClass(PsiDirectory dir,
java.lang.String name,
java.lang.String templateName,
boolean askForUndefinedVariables) |
abstract PsiClass |
createClass(PsiDirectory dir,
java.lang.String name,
java.lang.String templateName,
boolean askForUndefinedVariables,
java.util.Map<java.lang.String,java.lang.String> additionalProperties) |
abstract PsiClass |
createEnum(PsiDirectory dir,
java.lang.String name)
Creates an enumeration class with the specified name in the directory.
|
abstract PsiClass |
createInterface(PsiDirectory dir,
java.lang.String name)
Creates an interface class with the specified name in the directory.
|
abstract PsiClass |
createRecord(PsiDirectory dir,
java.lang.String name)
Creates a record class with the specified name in the directory.
|
abstract PsiClass [] |
getClasses(PsiDirectory dir)
Returns the list of Java classes contained in the directory.
|
static JavaDirectoryService |
getInstance() |
abstract LanguageLevel |
getLanguageLevel(PsiDirectory dir) |
abstract PsiPackage |
getPackage(PsiDirectory dir)
Returns the package corresponding to the directory.
|
abstract PsiPackage |
getPackageInSources(PsiDirectory dir)
Returns the package corresponding to the directory.
|
abstract boolean |
isSourceRoot(PsiDirectory dir)
Checks if the directory is a source root for the project to which it belongs.
|
public static JavaDirectoryService getInstance()
public abstract PsiPackage getPackage(PsiDirectory dir)
public abstract PsiPackage getPackageInSources(PsiDirectory dir)
public abstract PsiClass [] getClasses(PsiDirectory dir)
public abstract PsiClass createClass(PsiDirectory dir, 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.public abstract PsiClass createClass(PsiDirectory dir, java.lang.String name, java.lang.String templateName) throws IncorrectOperationException
name
- the name of the class to create (not including the file extension).templateName
- custom file template to create class text based on.IncorrectOperationException
- if the operation failed for some reason.public abstract PsiClass createClass(PsiDirectory dir, java.lang.String name, java.lang.String templateName, boolean askForUndefinedVariables) throws IncorrectOperationException
askForUndefinedVariables
- true show dialog asking for undefined variables
false leave them blankIncorrectOperationException
public abstract PsiClass createClass(PsiDirectory dir, java.lang.String name, java.lang.String templateName, boolean askForUndefinedVariables, java.util.Map<java.lang.String,java.lang.String> additionalProperties) throws IncorrectOperationException
additionalProperties
- additional properties to be substituted in the templateIncorrectOperationException
public abstract void checkCreateClass(PsiDirectory dir, 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.public abstract PsiClass createInterface(PsiDirectory dir, 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.public abstract PsiClass createEnum(PsiDirectory dir, 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.public abstract PsiClass createRecord(PsiDirectory dir, java.lang.String name) throws IncorrectOperationException
name
- the name of the record class to create (not including the file extension).IncorrectOperationException
- if the operation failed for some reason.public abstract PsiClass createAnnotationType(PsiDirectory dir, 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.public abstract boolean isSourceRoot(PsiDirectory dir)
public abstract LanguageLevel getLanguageLevel(PsiDirectory dir)