Class DOMASTUtil
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.dom.util.DOMASTUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckASTLevel(int level)static booleanisFeatureSupportedinAST(int apiLevel, boolean previewEnabled, int featureName)Validates if the givenapiLevelandpreviewEnabledsupports the providednodeType.static booleanisFeatureSupportedinAST(AST ast, int featureName)Validates if the givenapiLevelandpreviewEnabledsupports the providednodeType.static booleanstatic booleanisRecordDeclarationSupported(int apiLevel)static booleanstatic booleanisSealedTypeSupported(AST ast)static booleanstatic booleanisTextBlockSupported(AST ast)static booleanisYieldStatementSupported(AST ast)
-
Constructor Details
-
DOMASTUtil
public DOMASTUtil()
-
-
Method Details
-
isFeatureSupportedinAST
Validates if the givenapiLevelandpreviewEnabledsupports the providednodeType. This API checks for node types supported from JLS 14 onwards and will returntrue>for nodes added before JLS14.- Parameters:
ast- the AST to be evaluatedfeatureName- the feature name constant indicating the feature to be evaluated- Returns:
trueif the givenASTsupports the providednodeTypeelsefalse- Since:
- 3.22
- See Also:
ASTNode.getNodeType()
-
isFeatureSupportedinAST
public static boolean isFeatureSupportedinAST(int apiLevel, boolean previewEnabled, int featureName)Validates if the givenapiLevelandpreviewEnabledsupports the providednodeType. This API checks for node types supported from JLS 14 onwards and will returntrue>for nodes added before JLS14.- Parameters:
apiLevel- the level to be checkedpreviewEnabled- the preview feature to be consideredfeatureName- the feature name constant indicating the feature to be evaluated- Returns:
trueif the givenASTsupports the providednodeTypeelsefalse- Since:
- 3.22
- See Also:
ASTNode.getNodeType()
-
isSwitchExpressionSupported
-
isYieldStatementSupported
-
isTextBlockSupported
-
isRecordDeclarationSupported
-
isRecordDeclarationSupported
public static boolean isRecordDeclarationSupported(int apiLevel) -
isPatternInstanceofExpressionSupported
-
isSealedTypeSupported
-
checkASTLevel
public static void checkASTLevel(int level)
-