public interface PsiJavaParserFacade
Modifier and Type | Method and Description |
---|---|
PsiAnnotation |
createAnnotationFromText(java.lang.String annotationText,
PsiElement context)
Creates an annotation from the specified text.
|
PsiClass |
createClassFromText(java.lang.String text,
PsiElement context)
Creates a Java class with a dummy name from the specified body text (the text between the braces).
|
PsiCodeBlock |
createCodeBlockFromText(java.lang.String text,
PsiElement context)
Creates a Java code block from the specified text.
|
PsiComment |
createCommentFromText(java.lang.String text,
PsiElement context)
Creates a Java comment from the specified text.
|
PsiDocComment |
createDocCommentFromText(java.lang.String text)
Creates a JavaDoc comment from the specified text.
|
PsiDocComment |
createDocCommentFromText(java.lang.String text,
PsiElement context)
Creates a JavaDoc comment from the specified text.
|
PsiDocTag |
createDocTagFromText(java.lang.String text)
Creates a JavaDoc tag from the specified text.
|
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 |
createFieldFromText(java.lang.String text,
PsiElement context)
Creates a Java field from the specified text.
|
PsiMethod |
createMethodFromText(java.lang.String text,
PsiElement context)
Creates a Java method from the specified text.
|
PsiMethod |
createMethodFromText(java.lang.String text,
PsiElement context,
LanguageLevel languageLevel)
Creates a Java method from the specified text with the specified language level.
|
default PsiJavaModule |
createModuleFromText(java.lang.String text)
Deprecated.
|
PsiJavaModule |
createModuleFromText(java.lang.String text,
PsiElement context)
Creates a Java module declaration from the specified text.
|
PsiJavaModuleReferenceElement |
createModuleReferenceFromText(java.lang.String text,
PsiElement context)
Creates a Java module reference element from the specified text.
|
PsiStatement |
createModuleStatementFromText(java.lang.String text,
PsiElement context)
Creates a Java module statement from the specified text.
|
PsiParameter |
createParameterFromText(java.lang.String text,
PsiElement context)
Creates a Java method parameter from the specified text.
|
PsiType |
createPrimitiveTypeFromText(java.lang.String text)
Creates a Java type from the specified text.
|
PsiRecordHeader |
createRecordHeaderFromText(java.lang.String text,
PsiElement context)
Creates a Java record header from the specified text (excluding parentheses).
|
PsiJavaCodeReferenceElement |
createReferenceFromText(java.lang.String text,
PsiElement context)
Creates a Java code reference from the specified text.
|
PsiResourceVariable |
createResourceFromText(java.lang.String text,
PsiElement context)
Creates a Java try-resource from the specified text.
|
PsiStatement |
createStatementFromText(java.lang.String text,
PsiElement context)
Creates a Java statement from the specified text.
|
PsiTypeElement |
createTypeElementFromText(java.lang.String text,
PsiElement context)
Creates a Java type element from the specified text.
|
PsiType |
createTypeFromText(java.lang.String text,
PsiElement context)
Creates a Java type from the specified text.
|
PsiTypeParameter |
createTypeParameterFromText(java.lang.String text,
PsiElement context)
Creates a type parameter from the specified text.
|
PsiDocTag createDocTagFromText(java.lang.String text) throws IncorrectOperationException
text
- the text of the JavaDoc tag.IncorrectOperationException
- if the text of the tag is not valid.PsiDocComment createDocCommentFromText(java.lang.String text) throws IncorrectOperationException
text
- the text of the JavaDoc comment.IncorrectOperationException
- if the text of the comment is not valid.PsiDocComment createDocCommentFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- the text of the JavaDoc comment.context
- the PSI element used as context for resolving references inside this javadocIncorrectOperationException
- if the text of the comment is not valid.PsiClass createClassFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- the body text of the class to create.context
- the PSI element used as context for resolving references which cannot be resolved
within the class.IncorrectOperationException
- if the text is not a valid class body.PsiField createFieldFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiMethod createMethodFromText(java.lang.String text, PsiElement context, LanguageLevel languageLevel) throws IncorrectOperationException
text
- the text of the method to create.context
- the PSI element used as context for resolving references from the method.languageLevel
- the language level used for creating the method.IncorrectOperationException
- if the text is not a valid method body.PsiMethod createMethodFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- the text of the method to create.context
- the PSI element used as context for resolving references from the method.IncorrectOperationException
- if the text is not a valid method body.PsiParameter createParameterFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiRecordHeader createRecordHeaderFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- the text of the record header to create.context
- the PSI element used as context for resolving references from the header.IncorrectOperationException
- if the text is not a valid record header text.PsiResourceVariable createResourceFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- the text of the resource to create.context
- the PSI element used as context for resolving references from the resource.IncorrectOperationException
- if the text is not a valid resource definition.PsiType createTypeFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiTypeElement createTypeElementFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiJavaCodeReferenceElement createReferenceFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiCodeBlock createCodeBlockFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiStatement createStatementFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiExpression createExpressionFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiComment createCommentFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- the text of the comment to create.context
- the PSI element used as context for resolving references from the comment.IncorrectOperationException
- if the text does not specify a valid comment.PsiTypeParameter createTypeParameterFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
text
- 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.PsiAnnotation createAnnotationFromText(java.lang.String annotationText, PsiElement context) throws IncorrectOperationException
annotationText
- 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.PsiEnumConstant createEnumConstantFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
IncorrectOperationException
PsiType createPrimitiveTypeFromText(java.lang.String text) throws IncorrectOperationException
text
- the text of the type to create (a primitive type keyword).IncorrectOperationException
- if some of the parameters are not valid.@Deprecated default PsiJavaModule createModuleFromText(java.lang.String text) throws IncorrectOperationException
createModuleFromText(String, PsiElement)
IncorrectOperationException
PsiJavaModule createModuleFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
IncorrectOperationException
PsiStatement createModuleStatementFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
IncorrectOperationException
PsiJavaModuleReferenceElement createModuleReferenceFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
IncorrectOperationException