public final class PsiElementFactoryImpl extends PsiJavaParserFacadeImpl implements PsiElementFactory
PsiElementFactory.SERVICEmyManager, REFERENCE| Constructor and Description |
|---|
PsiElementFactoryImpl(Project project) |
| Modifier and Type | Method and Description |
|---|---|
PsiAnnotation |
createAnnotationFromText(java.lang.String annotationText,
PsiElement context)
Creates an annotation from the specified text.
|
PsiAnnotation |
createAnnotationFromText(java.lang.String annotationText,
PsiElement context,
boolean markGenerated) |
PsiClass |
createAnnotationType(java.lang.String name)
Creates an empty annotation type with the specified name.
|
PsiCatchSection |
createCatchSection(PsiType exceptionType,
java.lang.String exceptionName,
PsiElement context)
Creates a
catch section for catching an exception of the specified
type and name. |
PsiClass |
createClass(java.lang.String name)
Creates an empty class with the specified name.
|
PsiClassInitializer |
createClassInitializer()
Creates an empty class initializer block.
|
PsiJavaCodeReferenceElement |
createClassReferenceElement(PsiClass aClass)
Creates a reference element resolving to the specified class.
|
PsiCodeBlock |
createCodeBlock()
Creates an empty Java code block.
|
PsiCodeBlock |
createCodeBlockFromText(java.lang.String text,
PsiElement context)
Creates a Java code block from the specified text.
|
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.
|
PsiElement |
createDummyHolder(java.lang.String text,
IElementType type,
PsiElement context)
Create a lightweight PsiElement of given element type in a lightweight non-physical PsiFile (aka DummyHolder) in a given context.
|
PsiClass |
createEnum(java.lang.String name)
Creates an empty enum with the specified name.
|
PsiEnumConstant |
createEnumConstantFromText(java.lang.String text,
PsiElement context) |
PsiExpression |
createExpressionFromText(java.lang.String text,
PsiElement context)
Creates a Java expression from the specified text.
|
PsiField |
createField(java.lang.String name,
PsiType type)
Creates a field with the specified name and type.
|
PsiField |
createFieldFromText(java.lang.String text,
PsiElement context)
Creates a Java field from the specified text.
|
PsiJavaCodeReferenceElement |
createFQClassNameReferenceElement(java.lang.String qName,
GlobalSearchScope resolveScope)
Creates a reference element resolving to the class with the specified name
in the specified search scope.
|
PsiIdentifier |
createIdentifier(java.lang.String text)
Creates a Java identifier with the specified text.
|
PsiImportStatement |
createImportStatement(PsiClass aClass)
Creates an import statement for importing the specified class.
|
PsiImportStatement |
createImportStatementOnDemand(java.lang.String packageName)
Creates an on-demand import statement for importing classes from the package with the specified name.
|
PsiImportStaticStatement |
createImportStaticStatement(PsiClass aClass,
java.lang.String memberName)
Creates an
import static statement for importing the specified member
from the specified class. |
PsiClass |
createInterface(java.lang.String name)
Creates an empty interface with the specified name.
|
PsiKeyword |
createKeyword(java.lang.String text)
Creates a Java keyword with the specified text.
|
PsiKeyword |
createKeyword(java.lang.String keyword,
PsiElement context) |
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,
LanguageLevel level)
Creates a Java method from the specified text with the specified language level.
|
PsiJavaCodeReferenceElement |
createPackageReferenceElement(PsiPackage aPackage)
Creates a reference element resolving to the specified package.
|
PsiJavaCodeReferenceElement |
createPackageReferenceElement(java.lang.String packageName)
Creates a reference element resolving to the package with the specified name.
|
PsiPackageStatement |
createPackageStatement(java.lang.String name)
Creates a package statement for the specified package name.
|
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.
|
PsiParameter |
createParameterFromText(java.lang.String text,
PsiElement context)
Creates a Java method parameter from the specified text.
|
PsiParameterList |
createParameterList(java.lang.String [] names,
PsiType [] types)
Creates a parameter list from the specified parameter names and types.
|
PsiDocTag |
createParamTag(java.lang.String parameterName,
java.lang.String description)
Creates a PSI element for the "@param" JavaDoc tag.
|
PsiPrimitiveType |
createPrimitiveType(java.lang.String text)
Returns the primitive type instance for the specified type name.
|
PsiSubstitutor |
createRawSubstitutor(PsiSubstitutor baseSubstitutor,
PsiTypeParameter [] typeParameters) |
PsiSubstitutor |
createRawSubstitutor(PsiTypeParameterListOwner owner)
Creates a substitutor for the specified class which replaces all type parameters
with their corresponding raw types.
|
PsiJavaCodeReferenceElement |
createReferenceElementByFQClassName(java.lang.String qName,
GlobalSearchScope resolveScope)
Creates a reference element resolving to the class with the specified name
in the specified search scope.
|
PsiJavaCodeReferenceElement |
createReferenceElementByType(PsiClassType type)
Creates a reference element resolving to the specified class type.
|
PsiReferenceExpression |
createReferenceExpression(PsiClass aClass)
Creates a reference expression resolving to the specified class.
|
PsiReferenceExpression |
createReferenceExpression(PsiPackage aPackage)
Creates a reference expression resolving to the specified package.
|
PsiReferenceList |
createReferenceList(PsiJavaCodeReferenceElement [] references)
Creates a reference list element from the specified array of references.
|
PsiResourceVariable |
createResourceVariable(java.lang.String name,
PsiType type,
PsiExpression initializer,
PsiElement context)
Creates a resource variable (which can be inserted into the resource list of try-with-resources statement)
with the specified name, type and initializer
|
PsiStatement |
createStatementFromText(java.lang.String text,
PsiElement context)
Creates a Java statement from the specified text.
|
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
to replace generic type parameters on the class.
|
PsiClassType |
createType(PsiClass aClass,
PsiType... parameters) |
PsiClassType |
createType(PsiClass aClass,
PsiType parameter) |
PsiClassType |
createType(PsiJavaCodeReferenceElement classReference)
Creates a class type for the specified reference pointing to a class.
|
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.
|
PsiTypeElement |
createTypeElement(PsiType psiType)
Creates a type element referencing the specified type.
|
PsiType |
createTypeFromText(java.lang.String text,
PsiElement context)
Creates a Java type from the specified text.
|
PsiTypeParameter |
createTypeParameter(java.lang.String name,
PsiClassType [] superTypes)
Creates new type parameter with the specified name and super types.
|
PsiTypeParameter |
createTypeParameterFromText(java.lang.String text,
PsiElement context)
Creates a type parameter from the specified text.
|
PsiTypeParameterList |
createTypeParameterList()
Creates an empty type parameter list.
|
PsiDeclarationStatement |
createVariableDeclarationStatement(java.lang.String name,
PsiType type,
PsiExpression initializer)
Creates a local variable declaration statement with the specified name, type and initializer,
optionally without reformatting the declaration.
|
PsiDeclarationStatement |
createVariableDeclarationStatement(java.lang.String name,
PsiType type,
PsiExpression initializer,
PsiElement context)
Creates a local variable declaration statement with the specified name, type and initializer,
optionally without reformatting the declaration.
|
PsiClass |
getArrayClass(LanguageLevel languageLevel)
Returns a synthetic Java class containing methods which are defined on Java arrays.
|
PsiClassType |
getArrayClassType(PsiType componentType,
LanguageLevel languageLevel)
Returns the class type for a synthetic Java class containing methods which
are defined on Java arrays with the specified element type.
|
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.
|
createClassFromText, createCommentFromText, createDocCommentFromText, createDocCommentFromText, createDocTagFromText, createDummyJavaFile, createMethodFromText, createModuleFromText, createModuleReferenceFromText, createModuleStatementFromText, createPrimitiveTypeFromText, createRecord, createRecordHeaderFromText, createReferenceFromText, createResourceFromText, createTypeElementFromText, getPrimitiveType, levelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateRecord, getInstancecreateClassFromText, createCommentFromText, createDocCommentFromText, createDocCommentFromText, createDocTagFromText, createMethodFromText, createModuleFromText, createModuleFromText, createModuleReferenceFromText, createModuleStatementFromText, createPrimitiveTypeFromText, createRecordHeaderFromText, createReferenceFromText, createResourceFromText, createTypeElementFromTextcreateDocCommentFromText, createMethodFromTextpublic PsiElementFactoryImpl(Project project)
public PsiClass getArrayClass(LanguageLevel languageLevel)
PsiElementFactorygetArrayClass in interface PsiElementFactorylanguageLevel - language level used to construct array class.public PsiClassType getArrayClassType(PsiType componentType, LanguageLevel languageLevel)
PsiElementFactorygetArrayClassType in interface PsiElementFactorylanguageLevel - language level used to construct array class.public PsiClassType createType(PsiClass resolve, PsiSubstitutor substitutor)
PsiElementFactorycreateType in interface JVMElementFactorycreateType in interface PsiElementFactorypublic PsiClassType createType(PsiClass resolve, PsiSubstitutor substitutor, LanguageLevel languageLevel)
PsiElementFactorycreateType in interface JVMElementFactorycreateType in interface PsiElementFactoryresolve - the class for which the class type is created.substitutor - the substitutor to use.languageLevel - to memorize language level for allowing/prohibiting boxing/unboxing.public PsiClass createClass(java.lang.String name) throws IncorrectOperationException
PsiElementFactorycreateClass in interface JVMElementFactorycreateClass in interface PsiElementFactoryIncorrectOperationException - if name is not a valid Java identifier.public PsiClass createInterface(java.lang.String name) throws IncorrectOperationException
PsiElementFactorycreateInterface in interface JVMElementFactorycreateInterface in interface PsiElementFactoryIncorrectOperationException - if name is not a valid Java identifier.public PsiClass createEnum(java.lang.String name) throws IncorrectOperationException
PsiElementFactorycreateEnum in interface JVMElementFactorycreateEnum in interface PsiElementFactoryIncorrectOperationException - if name is not a valid Java identifier.public PsiClass createAnnotationType(java.lang.String name) throws IncorrectOperationException
PsiElementFactorycreateAnnotationType in interface JVMElementFactorycreateAnnotationType in interface PsiElementFactoryIncorrectOperationException - if name is not a valid Java identifier.public PsiTypeElement createTypeElement(PsiType psiType)
PsiElementFactorycreateTypeElement in interface PsiElementFactorypublic PsiJavaCodeReferenceElement createReferenceElementByType(PsiClassType type)
PsiElementFactorycreateReferenceElementByType in interface JVMElementFactorycreateReferenceElementByType in interface PsiElementFactorytype - the class type to create the reference to.public PsiTypeParameterList createTypeParameterList()
JVMElementFactorycreateTypeParameterList in interface JVMElementFactorypublic PsiTypeParameter createTypeParameter(java.lang.String name, PsiClassType [] superTypes)
JVMElementFactorycreateTypeParameter in interface JVMElementFactorypublic PsiField createField(java.lang.String name, PsiType type) throws IncorrectOperationException
PsiElementFactorycreateField in interface JVMElementFactorycreateField in interface PsiElementFactoryIncorrectOperationException - name is not a valid Java identifier
or type represents an invalid type.public PsiMethod createMethod(java.lang.String name, PsiType returnType) throws IncorrectOperationException
PsiElementFactorycreateMethod in interface JVMElementFactorycreateMethod in interface PsiElementFactoryIncorrectOperationException - name is not a valid Java identifier
or type represents an invalid type.public PsiMethod createMethod(java.lang.String name, PsiType returnType, PsiElement context) throws IncorrectOperationException
JVMElementFactorycreateMethod in interface JVMElementFactoryIncorrectOperationException - name is not a valid Java identifier or type represents an invalid type.public PsiMethod createConstructor()
PsiElementFactorycreateConstructor in interface JVMElementFactorycreateConstructor in interface PsiElementFactorypublic PsiMethod createConstructor(java.lang.String name)
PsiElementFactorycreateConstructor in interface JVMElementFactorycreateConstructor in interface PsiElementFactorypublic PsiMethod createConstructor(java.lang.String name, PsiElement context)
JVMElementFactorycreateConstructor in interface JVMElementFactorypublic PsiClassInitializer createClassInitializer() throws IncorrectOperationException
PsiElementFactorycreateClassInitializer in interface JVMElementFactorycreateClassInitializer in interface PsiElementFactoryIncorrectOperationException - in case of an internal error.public PsiParameter createParameter(java.lang.String name, PsiType type) throws IncorrectOperationException
PsiElementFactorycreateParameter in interface JVMElementFactorycreateParameter in interface PsiElementFactoryIncorrectOperationException - name is not a valid Java identifier
or type represents an invalid type.public PsiParameter createParameter(java.lang.String name, PsiType type, PsiElement context) throws IncorrectOperationException
JVMElementFactorycreateParameter in interface JVMElementFactoryIncorrectOperationException - name is not a valid Java identifier or type represents an invalid type.public PsiCodeBlock createCodeBlock()
PsiElementFactorycreateCodeBlock in interface PsiElementFactorypublic PsiClassType createType(PsiClass aClass)
JVMElementFactorycreateType in interface JVMElementFactorypublic PsiClassType createType(PsiJavaCodeReferenceElement classReference)
PsiElementFactorycreateType in interface PsiElementFactorypublic PsiClassType createType(PsiClass aClass, PsiType parameter)
createType in interface JVMElementFactorycreateType in interface PsiElementFactorypublic PsiClassType createType(PsiClass aClass, PsiType... parameters)
createType in interface JVMElementFactorycreateType in interface PsiElementFactorypublic PsiSubstitutor createRawSubstitutor(PsiTypeParameterListOwner owner)
PsiElementFactorycreateRawSubstitutor in interface JVMElementFactorycreateRawSubstitutor in interface PsiElementFactorypublic PsiSubstitutor createRawSubstitutor(PsiSubstitutor baseSubstitutor, PsiTypeParameter [] typeParameters)
createRawSubstitutor in interface PsiElementFactorypublic PsiElement createDummyHolder(java.lang.String text, IElementType type, PsiElement context)
PsiElementFactoryPsiParser.parse(IElementType, com.intellij.lang.PsiBuilder).createDummyHolder in interface PsiElementFactorytext - text to parsetype - node typecontext - contextpublic PsiSubstitutor createSubstitutor(java.util.Map<PsiTypeParameter,PsiType> map)
PsiElementFactorycreateSubstitutor in interface JVMElementFactorycreateSubstitutor in interface PsiElementFactorypublic PsiPrimitiveType createPrimitiveType(java.lang.String text)
PsiElementFactorycreatePrimitiveType in interface JVMElementFactorycreatePrimitiveType in interface PsiElementFactorytext - the name of a Java primitive type (for example, int)null if name is not a valid
primitive type name.public PsiClassType createTypeByFQClassName(java.lang.String qName)
PsiElementFactoryPsiElementFactory.createTypeByFQClassName(String, GlobalSearchScope)
with GlobalSearchScope.allScope(Project).createTypeByFQClassName in interface JVMElementFactorycreateTypeByFQClassName in interface PsiElementFactorypublic PsiClassType createTypeByFQClassName(java.lang.String qName, GlobalSearchScope resolveScope)
PsiElementFactorycreateTypeByFQClassName in interface JVMElementFactorycreateTypeByFQClassName in interface PsiElementFactorypublic PsiJavaCodeReferenceElement createClassReferenceElement(PsiClass aClass)
PsiElementFactorycreateClassReferenceElement in interface PsiElementFactorypublic PsiJavaCodeReferenceElement createReferenceElementByFQClassName(java.lang.String qName, GlobalSearchScope resolveScope)
PsiElementFactorycreateReferenceElementByFQClassName in interface PsiElementFactorypublic PsiJavaCodeReferenceElement createFQClassNameReferenceElement(java.lang.String qName, GlobalSearchScope resolveScope)
PsiElementFactorycreateFQClassNameReferenceElement in interface PsiElementFactorypublic PsiJavaCodeReferenceElement createPackageReferenceElement(PsiPackage aPackage) throws IncorrectOperationException
PsiElementFactorycreatePackageReferenceElement in interface PsiElementFactoryIncorrectOperationException - if aPackage is the default (root) package.public PsiPackageStatement createPackageStatement(java.lang.String name) throws IncorrectOperationException
PsiElementFactorycreatePackageStatement in interface PsiElementFactoryIncorrectOperationException - if name is not a valid package name.public PsiImportStaticStatement createImportStaticStatement(PsiClass aClass, java.lang.String memberName) throws IncorrectOperationException
PsiElementFactoryimport static statement for importing the specified member
from the specified class.createImportStaticStatement in interface PsiElementFactoryIncorrectOperationException - if the class is inner or local, or
memberName is not a valid identifier.public PsiParameterList createParameterList(java.lang.String [] names, PsiType [] types) throws IncorrectOperationException
PsiElementFactorycreateParameterList in interface JVMElementFactorycreateParameterList in interface PsiElementFactoryIncorrectOperationException - if any of the parameter names or types are invalid.public PsiReferenceList createReferenceList(PsiJavaCodeReferenceElement [] references) throws IncorrectOperationException
PsiElementFactorycreateReferenceList in interface PsiElementFactoryIncorrectOperationException - if some of the references are invalid.public PsiJavaCodeReferenceElement createPackageReferenceElement(java.lang.String packageName) throws IncorrectOperationException
PsiElementFactorycreatePackageReferenceElement in interface PsiElementFactoryIncorrectOperationException - if packageName is an empty string.public PsiReferenceExpression createReferenceExpression(PsiClass aClass) throws IncorrectOperationException
PsiElementFactorycreateReferenceExpression in interface PsiElementFactoryIncorrectOperationException - never (the exception is kept for compatibility purposes).public PsiReferenceExpression createReferenceExpression(PsiPackage aPackage) throws IncorrectOperationException
PsiElementFactorycreateReferenceExpression in interface PsiElementFactoryIncorrectOperationException - if aPackage is the default (root) package.public PsiIdentifier createIdentifier(java.lang.String text) throws IncorrectOperationException
PsiElementFactorycreateIdentifier in interface PsiElementFactoryIncorrectOperationException - if text is not a valid Java identifier.public PsiKeyword createKeyword(java.lang.String text) throws IncorrectOperationException
PsiElementFactorycreateKeyword in interface PsiElementFactoryIncorrectOperationException - if text is not a valid Java keyword.public PsiKeyword createKeyword(java.lang.String keyword, PsiElement context) throws IncorrectOperationException
createKeyword in interface PsiElementFactoryIncorrectOperationExceptionpublic PsiImportStatement createImportStatement(PsiClass aClass) throws IncorrectOperationException
PsiElementFactorycreateImportStatement in interface PsiElementFactoryIncorrectOperationException - if aClass is an anonymous or local class.public PsiImportStatement createImportStatementOnDemand(java.lang.String packageName) throws IncorrectOperationException
PsiElementFactorycreateImportStatementOnDemand in interface PsiElementFactoryIncorrectOperationException - if packageName is not a valid qualified package name.public PsiDeclarationStatement createVariableDeclarationStatement(java.lang.String name, PsiType type, PsiExpression initializer) throws IncorrectOperationException
PsiElementFactory
Note that depending on code style settings the resulting variable may be declared as final.
createVariableDeclarationStatement in interface PsiElementFactoryIncorrectOperationException - if name is not a valid identifier or
type is not a valid type.public PsiDeclarationStatement createVariableDeclarationStatement(java.lang.String name, PsiType type, PsiExpression initializer, PsiElement context) throws IncorrectOperationException
PsiElementFactory
Note that depending on code style settings the resulting variable may be declared as final.
createVariableDeclarationStatement in interface PsiElementFactorycontext - the context used to resolve symbols in the resulting declaration.IncorrectOperationException - if name is not a valid identifier or
type is not a valid type.public PsiResourceVariable createResourceVariable(java.lang.String name, PsiType type, PsiExpression initializer, PsiElement context)
PsiElementFactorycreateResourceVariable in interface PsiElementFactorycontext - the context for dummy holderpublic PsiDocTag createParamTag(java.lang.String parameterName, java.lang.String description) throws IncorrectOperationException
PsiElementFactorycreateParamTag in interface PsiElementFactoryIncorrectOperationException - if the name or description are invalid.public PsiAnnotation createAnnotationFromText(java.lang.String annotationText, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateAnnotationFromText in interface JVMElementFactorycreateAnnotationFromText in interface PsiJavaParserFacadecreateAnnotationFromText in class PsiJavaParserFacadeImplannotationText - the text of the annotation to create.context - the context for resolving references from the annotation.IncorrectOperationException - if the text does not specify a valid annotation.public PsiAnnotation createAnnotationFromText(java.lang.String annotationText, PsiElement context, boolean markGenerated) throws IncorrectOperationException
IncorrectOperationExceptionpublic PsiCodeBlock createCodeBlockFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateCodeBlockFromText in interface PsiJavaParserFacadecreateCodeBlockFromText in class PsiJavaParserFacadeImpltext - the text of the code block to create.context - the PSI element used as context for resolving references from the block.IncorrectOperationException - if the text does not specify a valid code block.public PsiEnumConstant createEnumConstantFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
createEnumConstantFromText in interface PsiJavaParserFacadecreateEnumConstantFromText in class PsiJavaParserFacadeImplIncorrectOperationExceptionpublic PsiExpression createExpressionFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateExpressionFromText in interface JVMElementFactorycreateExpressionFromText in interface PsiElementFactorycreateExpressionFromText in interface PsiJavaParserFacadecreateExpressionFromText in class PsiJavaParserFacadeImpltext - the text of the expression to create.context - the PSI element used as context for resolving references from the expression.IncorrectOperationException - if the text does not specify a valid expression.public PsiField createFieldFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateFieldFromText in interface PsiJavaParserFacadecreateFieldFromText in class PsiJavaParserFacadeImpltext - the text of the field to create.context - the PSI element used as context for resolving references from the field.IncorrectOperationException - if the text is not a valid field body.public PsiParameter createParameterFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateParameterFromText in interface PsiJavaParserFacadecreateParameterFromText in class PsiJavaParserFacadeImpltext - the text of the parameter to create.context - the PSI element used as context for resolving references from the parameter.IncorrectOperationException - if the text is not a valid parameter body.public PsiStatement createStatementFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateStatementFromText in interface PsiJavaParserFacadecreateStatementFromText in class PsiJavaParserFacadeImpltext - the text of the statement to create.context - the PSI element used as context for resolving references from the statement.IncorrectOperationException - if the text does not specify a valid statement.public PsiType createTypeFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateTypeFromText in interface PsiJavaParserFacadecreateTypeFromText in class PsiJavaParserFacadeImpltext - the text of the type to create (for example, a primitive type keyword, an array
declaration or the name of a class).context - the PSI element used as context for resolving the reference.IncorrectOperationException - if the text does not specify a valid type.public PsiTypeParameter createTypeParameterFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateTypeParameterFromText in interface PsiJavaParserFacadecreateTypeParameterFromText in class PsiJavaParserFacadeImpltext - the text of the type parameter to create.context - the context for resolving references.IncorrectOperationException - if the text does not specify a valid type parameter.public PsiMethod createMethodFromText(java.lang.String text, PsiElement context, LanguageLevel level) throws IncorrectOperationException
PsiJavaParserFacadecreateMethodFromText in interface PsiJavaParserFacadecreateMethodFromText in class PsiJavaParserFacadeImpltext - the text of the method to create.context - the PSI element used as context for resolving references from the method.level - the language level used for creating the method.IncorrectOperationException - if the text is not a valid method body.public PsiCatchSection createCatchSection(PsiType exceptionType, java.lang.String exceptionName, PsiElement context) throws IncorrectOperationException
PsiElementFactorycatch section for catching an exception of the specified
type and name.createCatchSection in interface PsiElementFactoryexceptionType - the type of the exception to catch (either PsiClassType or PsiDisjunctionType).exceptionName - the name of the variable in which the caught exception is stored (may be an empty string).context - the context for resolving references.IncorrectOperationException - if any of the parameters are not valid.public boolean isValidClassName(java.lang.String name)
JVMElementFactoryisValidClassName in interface JVMElementFactorypublic boolean isValidMethodName(java.lang.String name)
JVMElementFactoryisValidMethodName in interface JVMElementFactorypublic boolean isValidParameterName(java.lang.String name)
JVMElementFactoryisValidParameterName in interface JVMElementFactorypublic boolean isValidFieldName(java.lang.String name)
JVMElementFactoryisValidFieldName in interface JVMElementFactorypublic boolean isValidLocalVariableName(java.lang.String name)
JVMElementFactoryisValidLocalVariableName in interface JVMElementFactory