public class PsiJavaParserFacadeImpl extends java.lang.Object implements PsiJavaParserFacade
| Modifier and Type | Field and Description |
|---|---|
protected PsiManager |
myManager |
static JavaParserUtil.ParserWrapper |
REFERENCE |
| Constructor and Description |
|---|
PsiJavaParserFacadeImpl(Project project) |
| Modifier and Type | Method and Description |
|---|---|
PsiAnnotation |
createAnnotationFromText(java.lang.String text,
PsiElement context)
Creates an annotation from the specified text.
|
PsiClass |
createClassFromText(java.lang.String body,
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.
|
protected PsiJavaFile |
createDummyJavaFile(java.lang.String 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 level)
Creates a Java method from the specified text with the specified language level.
|
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.
|
PsiClass |
createRecord(java.lang.String name) |
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.
|
static PsiPrimitiveType |
getPrimitiveType(java.lang.String text) |
protected static LanguageLevel |
level(PsiElement context) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateModuleFromTextpublic static final JavaParserUtil.ParserWrapper REFERENCE
protected final PsiManager myManager
public PsiJavaParserFacadeImpl(Project project)
protected PsiJavaFile createDummyJavaFile(java.lang.String text)
public PsiAnnotation createAnnotationFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateAnnotationFromText in interface PsiJavaParserFacadetext - 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 PsiDocTag createDocTagFromText(java.lang.String text) throws IncorrectOperationException
PsiJavaParserFacadecreateDocTagFromText in interface PsiJavaParserFacadetext - the text of the JavaDoc tag.IncorrectOperationException - if the text of the tag is not valid.public PsiDocComment createDocCommentFromText(java.lang.String text) throws IncorrectOperationException
PsiJavaParserFacadecreateDocCommentFromText in interface PsiJavaParserFacadetext - the text of the JavaDoc comment.IncorrectOperationException - if the text of the comment is not valid.public PsiDocComment createDocCommentFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateDocCommentFromText in interface PsiJavaParserFacadetext - 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.public PsiClass createClassFromText(java.lang.String body, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateClassFromText in interface PsiJavaParserFacadebody - 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.public PsiClass createRecord(java.lang.String name) throws IncorrectOperationException
IncorrectOperationExceptionpublic PsiRecordHeader createRecordHeaderFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateRecordHeaderFromText in interface PsiJavaParserFacadetext - 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.public PsiField createFieldFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateFieldFromText in interface PsiJavaParserFacadetext - 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 PsiMethod createMethodFromText(java.lang.String text, PsiElement context, LanguageLevel level) throws IncorrectOperationException
PsiJavaParserFacadecreateMethodFromText in interface PsiJavaParserFacadetext - 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 PsiMethod createMethodFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateMethodFromText in interface PsiJavaParserFacadetext - 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.public PsiParameter createParameterFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateParameterFromText in interface PsiJavaParserFacadetext - 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 PsiResourceVariable createResourceFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateResourceFromText in interface PsiJavaParserFacadetext - 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.public PsiType createTypeFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateTypeFromText in interface PsiJavaParserFacadetext - 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 PsiTypeElement createTypeElementFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateTypeElementFromText in interface PsiJavaParserFacadetext - 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 PsiJavaCodeReferenceElement createReferenceFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateReferenceFromText in interface PsiJavaParserFacadetext - 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 PsiCodeBlock createCodeBlockFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateCodeBlockFromText in interface PsiJavaParserFacadetext - 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 PsiStatement createStatementFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateStatementFromText in interface PsiJavaParserFacadetext - 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 PsiExpression createExpressionFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateExpressionFromText in interface PsiJavaParserFacadetext - 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 PsiTypeParameter createTypeParameterFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateTypeParameterFromText in interface PsiJavaParserFacadetext - 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 PsiComment createCommentFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateCommentFromText in interface PsiJavaParserFacadetext - 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.public PsiEnumConstant createEnumConstantFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
createEnumConstantFromText in interface PsiJavaParserFacadeIncorrectOperationExceptionpublic PsiType createPrimitiveTypeFromText(java.lang.String text) throws IncorrectOperationException
PsiJavaParserFacadecreatePrimitiveTypeFromText in interface PsiJavaParserFacadetext - the text of the type to create (a primitive type keyword).IncorrectOperationException - if some of the parameters are not valid.public PsiJavaModule createModuleFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateModuleFromText in interface PsiJavaParserFacadeIncorrectOperationExceptionpublic PsiStatement createModuleStatementFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateModuleStatementFromText in interface PsiJavaParserFacadeIncorrectOperationExceptionpublic PsiJavaModuleReferenceElement createModuleReferenceFromText(java.lang.String text, PsiElement context) throws IncorrectOperationException
PsiJavaParserFacadecreateModuleReferenceFromText in interface PsiJavaParserFacadeIncorrectOperationExceptionpublic static PsiPrimitiveType getPrimitiveType(java.lang.String text)
protected static LanguageLevel level(PsiElement context)