KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > dom > EmptyStatement


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.core.dom;
13
14 import java.util.ArrayList JavaDoc;
15 import java.util.List JavaDoc;
16
17 /**
18  * Null statement AST node type.
19  *
20  * <pre>
21  * EmptyStatement:
22  * <b>;</b>
23  * </pre>
24  *
25  * @since 2.0
26  */

27 public class EmptyStatement extends Statement {
28
29     /**
30      * A list of property descriptors (element type:
31      * {@link StructuralPropertyDescriptor}),
32      * or null if uninitialized.
33      */

34     private static final List JavaDoc PROPERTY_DESCRIPTORS;
35     
36     static {
37         List JavaDoc properyList = new ArrayList JavaDoc(1);
38         createPropertyList(EmptyStatement.class, properyList);
39         PROPERTY_DESCRIPTORS = reapPropertyList(properyList);
40     }
41
42     /**
43      * Returns a list of structural property descriptors for this node type.
44      * Clients must not modify the result.
45      *
46      * @param apiLevel the API level; one of the
47      * <code>AST.JLS&ast;</code> constants
48
49      * @return a list of property descriptors (element type:
50      * {@link StructuralPropertyDescriptor})
51      * @since 3.0
52      */

53     public static List JavaDoc propertyDescriptors(int apiLevel) {
54         return PROPERTY_DESCRIPTORS;
55     }
56             
57     /**
58      * Creates a new unparented null statement node owned by the given AST.
59      * <p>
60      * N.B. This constructor is package-private.
61      * </p>
62      *
63      * @param ast the AST that is to own this node
64      */

65     EmptyStatement(AST ast) {
66         super(ast);
67     }
68     
69     /* (omit javadoc for this method)
70      * Method declared on ASTNode.
71      */

72     final List JavaDoc internalStructuralPropertiesForType(int apiLevel) {
73         return propertyDescriptors(apiLevel);
74     }
75     
76     /* (omit javadoc for this method)
77      * Method declared on ASTNode.
78      */

79     final int getNodeType0() {
80         return EMPTY_STATEMENT;
81     }
82
83     /* (omit javadoc for this method)
84      * Method declared on ASTNode.
85      */

86     ASTNode clone0(AST target) {
87         EmptyStatement result = new EmptyStatement(target);
88         result.setSourceRange(this.getStartPosition(), this.getLength());
89         result.copyLeadingComment(this);
90         return result;
91     }
92
93     /* (omit javadoc for this method)
94      * Method declared on ASTNode.
95      */

96     final boolean subtreeMatch0(ASTMatcher matcher, Object JavaDoc other) {
97         // dispatch to correct overloaded match method
98
return matcher.match(this, other);
99     }
100
101     /* (omit javadoc for this method)
102      * Method declared on ASTNode.
103      */

104     void accept0(ASTVisitor visitor) {
105         visitor.visit(this);
106         visitor.endVisit(this);
107     }
108     
109     /* (omit javadoc for this method)
110      * Method declared on ASTNode.
111      */

112     int treeSize() {
113         return memSize();
114     }
115 }
116
117
Popular Tags