KickJava   Java API By Example, From Geeks To Geeks.

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


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 literal node.
19  *
20  * @since 2.0
21  */

22 public class NullLiteral extends Expression {
23     
24     /**
25      * A list of property descriptors (element type:
26      * {@link StructuralPropertyDescriptor}),
27      * or null if uninitialized.
28      */

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

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

60     NullLiteral(AST ast) {
61         super(ast);
62     }
63
64     /* (omit javadoc for this method)
65      * Method declared on ASTNode.
66      */

67     final List JavaDoc internalStructuralPropertiesForType(int apiLevel) {
68         return propertyDescriptors(apiLevel);
69     }
70     
71     /* (omit javadoc for this method)
72      * Method declared on ASTNode.
73      */

74     final int getNodeType0() {
75         return NULL_LITERAL;
76     }
77
78     /* (omit javadoc for this method)
79      * Method declared on ASTNode.
80      */

81     ASTNode clone0(AST target) {
82         NullLiteral result = new NullLiteral(target);
83         result.setSourceRange(this.getStartPosition(), this.getLength());
84         return result;
85     }
86
87     /* (omit javadoc for this method)
88      * Method declared on ASTNode.
89      */

90     final boolean subtreeMatch0(ASTMatcher matcher, Object JavaDoc other) {
91         // dispatch to correct overloaded match method
92
return matcher.match(this, other);
93     }
94
95     /* (omit javadoc for this method)
96      * Method declared on ASTNode.
97      */

98     void accept0(ASTVisitor visitor) {
99         visitor.visit(this);
100         visitor.endVisit(this);
101     }
102     
103     /* (omit javadoc for this method)
104      * Method declared on ASTNode.
105      */

106     int memSize() {
107         return BASE_NODE_SIZE;
108     }
109     
110     /* (omit javadoc for this method)
111      * Method declared on ASTNode.
112      */

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