Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2020-04-10 16:10:58 +0000
committerStephan Herrmann2020-04-10 16:10:58 +0000
commitf59da2802d141661a4d4dbe0d1db7483098799fa (patch)
tree3a3db893959be1e248205fe85b1a23b75c7ec3da /org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
parenta964eeb6a3e516b6a5dd0803153154e59d82c165 (diff)
downloadorg.eclipse.objectteams-f59da2802d141661a4d4dbe0d1db7483098799fa.tar.gz
org.eclipse.objectteams-f59da2802d141661a4d4dbe0d1db7483098799fa.tar.xz
org.eclipse.objectteams-f59da2802d141661a4d4dbe0d1db7483098799fa.zip
update jdt.core to 07329519f5ac8fd8379eab265d25b2c09a24fd96 (before
whitespace change Bug 560451
Diffstat (limited to 'org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java')
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java48
1 files changed, 46 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
index 74bb7163b..44e574ea0 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -979,9 +979,18 @@ public abstract class ASTNode {
* @since 3.20
*/
public static final int TEXT_BLOCK = 102;
+
+ /**
+ * Node type constant indicating a node of type
+ * <code>RecordDeclaration</code>.
+ * @see RecordDeclaration
+ * @since 3.22
+ */
+ public static final int RECORD_DECLARATION = 103;
+
//{ObjectTeams: required OT specific node type constants added
- private static final int LAST_JDT = 102;
+ private static final int LAST_JDT = 103;
/**
* Node type constant indicating a node of type
* <code>MethodSpec</code>.
@@ -1224,6 +1233,8 @@ public abstract class ASTNode {
return QualifiedName.class;
case QUALIFIED_TYPE :
return QualifiedType.class;
+ case RECORD_DECLARATION :
+ return RecordDeclaration.class;
case REQUIRES_DIRECTIVE :
return RequiresDirective.class;
case RETURN_STATEMENT :
@@ -2271,6 +2282,23 @@ public abstract class ASTNode {
/**
* Checks that this AST operation is not used when
+ * building JLS2, JLS3, JLS4, JLS8, JLS9, JLS10, JLS11, JLS12 or JSL13 level ASTs.
+ * <p>
+ * Use this method to prevent access to new properties that have been added in JLS14
+ * </p>
+ *
+ * @exception UnsupportedOperationException if this operation is used below JLS14
+ * @since 3.22
+ */
+ final void unsupportedBelow14() {
+ if (this.ast.apiLevel < AST.JLS14_INTERNAL) {
+ throw new UnsupportedOperationException("Operation only supported in ASTs with level JLS14 and above"); //$NON-NLS-1$
+ }
+ }
+
+
+ /**
+ * Checks that this AST operation is not used when
* building ASTs without previewEnabled flag.
* <p>
* Use this method to prevent access to new properties that have been added with preview feature
@@ -2351,6 +2379,22 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in JLS13 AST"); //$NON-NLS-1$
}
}
+
+ /**
+ * Checks that this AST operation is only used when
+ * building JLS13 level ASTs.
+ * <p>
+ * Use this method to prevent access to new properties available only in JLS14.
+ * </p>
+ *
+ * @exception UnsupportedOperationException if this operation is not used in JLS14
+ * @since 3.20
+ */
+ final void supportedOnlyIn14() {
+ if (this.ast.apiLevel != AST.JLS14_INTERNAL) {
+ throw new UnsupportedOperationException("Operation only supported in JLS14 AST"); //$NON-NLS-1$
+ }
+ }
/**
* Sets or clears this node's parent node and location.
* <p>

Back to the top