java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.dom.util.DOMASTUtil

public class DOMASTUtil extends Object
  • Constructor Details

    • DOMASTUtil

      public DOMASTUtil()
  • Method Details

    • isFeatureSupportedinAST

      public static boolean isFeatureSupportedinAST(AST ast, int featureName)
      Validates if the given apiLevel and previewEnabled supports the provided nodeType. This API checks for node types supported from JLS 14 onwards and will return true> for nodes added before JLS14.
      Parameters:
      ast - the AST to be evaluated
      featureName - the feature name constant indicating the feature to be evaluated
      Returns:
      true if the given AST supports the provided nodeType else false
      Since:
      3.22
      See Also:
      ASTNode.getNodeType()
    • isFeatureSupportedinAST

      public static boolean isFeatureSupportedinAST(int apiLevel, boolean previewEnabled, int featureName)
      Validates if the given apiLevel and previewEnabled supports the provided nodeType. This API checks for node types supported from JLS 14 onwards and will return true> for nodes added before JLS14.
      Parameters:
      apiLevel - the level to be checked
      previewEnabled - the preview feature to be considered
      featureName - the feature name constant indicating the feature to be evaluated
      Returns:
      true if the given AST supports the provided nodeType else false
      Since:
      3.22
      See Also:
      ASTNode.getNodeType()
    • isSwitchExpressionSupported

      public static boolean isSwitchExpressionSupported(AST ast)
    • isYieldStatementSupported

      public static boolean isYieldStatementSupported(AST ast)
    • isTextBlockSupported

      public static boolean isTextBlockSupported(AST ast)
    • isRecordDeclarationSupported

      public static boolean isRecordDeclarationSupported(AST ast)
    • isRecordDeclarationSupported

      public static boolean isRecordDeclarationSupported(int apiLevel)
    • isPatternInstanceofExpressionSupported

      public static boolean isPatternInstanceofExpressionSupported(AST ast)
    • isSealedTypeSupported

      public static boolean isSealedTypeSupported(AST ast)
    • checkASTLevel

      public static void checkASTLevel(int level)