public interface JVMElementFactory
Modifier and Type | Method and Description |
---|---|
PsiAnnotation |
createAnnotationFromText(java.lang.String annotationText,
PsiElement context) |
PsiClass |
createAnnotationType(java.lang.String name)
Creates an empty annotation type with the specified name.
|
PsiClass |
createClass(java.lang.String name)
Creates an empty class with the specified name.
|
PsiClassInitializer |
createClassInitializer()
Creates an empty class initializer block.
|
PsiMethod |
createConstructor()
Creates an empty constructor.
|
PsiMethod |
createConstructor(java.lang.String name)
Creates an empty constructor with a given name.
|
PsiMethod |
createConstructor(java.lang.String name,
PsiElement context)
Creates an empty constructor with a given name in the given context.
|
PsiDocComment |
createDocCommentFromText(java.lang.String text)
Creates doc comment from text.
|
PsiClass |
createEnum(java.lang.String name)
Creates an empty enum with the specified name.
|
PsiElement |
createExpressionFromText(java.lang.String text,
PsiElement context) |
PsiField |
createField(java.lang.String name,
PsiType type)
Creates a field with the specified name and type.
|
PsiClass |
createInterface(java.lang.String name)
Creates an empty interface with the specified name.
|
PsiMethod |
createMethod(java.lang.String name,
PsiType returnType)
Creates an empty method with the specified name and return type.
|
PsiMethod |
createMethod(java.lang.String name,
PsiType returnType,
PsiElement context)
Creates an empty method with the specified name and return type in the given context.
|
PsiMethod |
createMethodFromText(java.lang.String text,
PsiElement context) |
PsiParameter |
createParameter(java.lang.String name,
PsiType type)
Creates a parameter with the specified name and type.
|
PsiParameter |
createParameter(java.lang.String name,
PsiType type,
PsiElement context)
Creates a parameter with the specified name and type in the given context.
|
PsiParameterList |
createParameterList(java.lang.String [] names,
PsiType [] types)
Creates a parameter list from the specified parameter names and types.
|
PsiPrimitiveType |
createPrimitiveType(java.lang.String text)
Returns the primitive type instance for the specified type name, or null if
name is not a valid primitive type name. |
PsiSubstitutor |
createRawSubstitutor(PsiTypeParameterListOwner owner)
Creates a substitutor for the specified class which replaces all type parameters with their corresponding raw types.
|
PsiElement |
createReferenceElementByType(PsiClassType type)
Creates a new reference element from the class type.
|
PsiSubstitutor |
createSubstitutor(java.util.Map<PsiTypeParameter,PsiType> map)
Creates a substitutor which uses the specified mapping between type parameters and types.
|
PsiClassType |
createType(PsiClass aClass)
Creates a class type for the specified class.
|
PsiClassType |
createType(PsiClass resolve,
PsiSubstitutor substitutor)
Creates a class type for the specified class, using the specified substitutor
to replace generic type parameters on the class.
|
PsiClassType |
createType(PsiClass resolve,
PsiSubstitutor substitutor,
LanguageLevel languageLevel)
Creates a class type for the specified class, using the specified substitutor and language level
to replace generic type parameters on the class.
|
PsiClassType |
createType(PsiClass aClass,
PsiType... parameters) |
PsiClassType |
createType(PsiClass aClass,
PsiType parameters) |
PsiClassType |
createTypeByFQClassName(java.lang.String qName)
|
PsiClassType |
createTypeByFQClassName(java.lang.String qName,
GlobalSearchScope resolveScope)
Creates a class type referencing a class with the specified class name in the specified search scope.
|
PsiTypeParameter |
createTypeParameter(java.lang.String name,
PsiClassType [] superTypes)
Creates new type parameter with the specified name and super types.
|
PsiTypeParameterList |
createTypeParameterList()
Creates an empty type parameter list.
|
boolean |
isValidClassName(java.lang.String name)
Checks whether the name is a valid class name in the current language.
|
boolean |
isValidFieldName(java.lang.String name)
Checks whether the name is a valid field name in the current language.
|
boolean |
isValidLocalVariableName(java.lang.String name)
Checks whether the name is a valid local variable name in the current language.
|
boolean |
isValidMethodName(java.lang.String name)
Checks whether the name is a valid method name in the current language.
|
boolean |
isValidParameterName(java.lang.String name)
Checks whether the name is a valid parameter name in the current language.
|
PsiClass createClass(java.lang.String name) throws IncorrectOperationException
IncorrectOperationException
- if name
is not a valid Java identifier.PsiClass createInterface(java.lang.String name) throws IncorrectOperationException
IncorrectOperationException
- if name
is not a valid Java identifier.PsiClass createEnum(java.lang.String name) throws IncorrectOperationException
IncorrectOperationException
- if name
is not a valid Java identifier.PsiField createField(java.lang.String name, PsiType type) throws IncorrectOperationException
IncorrectOperationException
- name
is not a valid Java identifier or type
represents an invalid type.PsiMethod createMethod(java.lang.String name, PsiType returnType) throws IncorrectOperationException
IncorrectOperationException
- name
is not a valid Java identifier or type
represents an invalid type.PsiMethod createMethod(java.lang.String name, PsiType returnType, PsiElement context) throws IncorrectOperationException
IncorrectOperationException
- name
is not a valid Java identifier or type
represents an invalid type.PsiMethod createConstructor()
PsiClassInitializer createClassInitializer()
PsiParameter createParameter(java.lang.String name, PsiType type) throws IncorrectOperationException
IncorrectOperationException
- name
is not a valid Java identifier or type
represents an invalid type.PsiParameter createParameter(java.lang.String name, PsiType type, PsiElement context) throws IncorrectOperationException
IncorrectOperationException
- name
is not a valid Java identifier or type
represents an invalid type.PsiParameterList createParameterList(java.lang.String [] names, PsiType [] types) throws IncorrectOperationException
IncorrectOperationException
- if some of the parameter names or types are invalid.PsiMethod createMethodFromText(java.lang.String text, PsiElement context)
PsiAnnotation createAnnotationFromText(java.lang.String annotationText, PsiElement context) throws IncorrectOperationException
IncorrectOperationException
PsiElement createExpressionFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
IncorrectOperationException
PsiElement createReferenceElementByType(PsiClassType type)
PsiTypeParameterList createTypeParameterList()
PsiTypeParameter createTypeParameter(java.lang.String name, PsiClassType [] superTypes)
PsiClassType createType(PsiClass aClass)
PsiClass createAnnotationType(java.lang.String name) throws IncorrectOperationException
IncorrectOperationException
- if name
is not a valid Java identifier.PsiMethod createConstructor(java.lang.String name)
PsiMethod createConstructor(java.lang.String name, PsiElement context)
PsiClassType createType(PsiClass resolve, PsiSubstitutor substitutor)
PsiClassType createType(PsiClass resolve, PsiSubstitutor substitutor, LanguageLevel languageLevel)
resolve
- the class for which the class type is created.substitutor
- the substitutor to use.languageLevel
- to memorize language level for allowing/prohibiting boxing/unboxing.PsiClassType createType(PsiClass aClass, PsiType parameters)
PsiClassType createType(PsiClass aClass, PsiType... parameters)
PsiSubstitutor createRawSubstitutor(PsiTypeParameterListOwner owner)
PsiSubstitutor createSubstitutor(java.util.Map<PsiTypeParameter,PsiType> map)
PsiPrimitiveType createPrimitiveType(java.lang.String text)
name
is not a valid primitive type name.PsiClassType createTypeByFQClassName(java.lang.String qName)
PsiClassType createTypeByFQClassName(java.lang.String qName, GlobalSearchScope resolveScope)
PsiDocComment createDocCommentFromText(java.lang.String text)
boolean isValidClassName(java.lang.String name)
boolean isValidMethodName(java.lang.String name)
boolean isValidParameterName(java.lang.String name)
boolean isValidFieldName(java.lang.String name)
boolean isValidLocalVariableName(java.lang.String name)