1 /*******************************************************************************
 
   2  * Copyright (c) 2000, 2008 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
 
   9  *     IBM Corporation - initial API and implementation
 
  10  *******************************************************************************/
 
  12 package net.sourceforge.phpdt.core.dom;
 
  14 import java.util.ArrayList;
 
  15 import java.util.List;
 
  21  * @noinstantiate This class is not intended to be instantiated by clients.
 
  23 public class NullLiteral extends Expression {
 
  26          * A list of property descriptors (element type: 
 
  27          * {@link StructuralPropertyDescriptor}),
 
  28          * or null if uninitialized.
 
  30         private static final List PROPERTY_DESCRIPTORS;
 
  33                 List propertyList = new ArrayList(1);
 
  34                 createPropertyList(NullLiteral.class, propertyList);
 
  35                 PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
 
  39          * Returns a list of structural property descriptors for this node type.
 
  40          * Clients must not modify the result.
 
  42          * @param apiLevel the API level; one of the
 
  43          * <code>AST.JLS*</code> constants
 
  45          * @return a list of property descriptors (element type: 
 
  46          * {@link StructuralPropertyDescriptor})
 
  49         public static List propertyDescriptors(int apiLevel) {
 
  50                 return PROPERTY_DESCRIPTORS;
 
  54          * Creates a new unparented null literal node owned by the given AST.
 
  56          * N.B. This constructor is package-private.
 
  59          * @param ast the AST that is to own this node
 
  61         NullLiteral(AST ast) {
 
  65         /* (omit javadoc for this method)
 
  66          * Method declared on ASTNode.
 
  68         final List internalStructuralPropertiesForType(int apiLevel) {
 
  69                 return propertyDescriptors(apiLevel);
 
  72         /* (omit javadoc for this method)
 
  73          * Method declared on ASTNode.
 
  75         final int getNodeType0() {
 
  79         /* (omit javadoc for this method)
 
  80          * Method declared on ASTNode.
 
  82         ASTNode clone0(AST target) {
 
  83                 NullLiteral result = new NullLiteral(target);
 
  84                 result.setSourceRange(this.getStartPosition(), this.getLength());
 
  88         /* (omit javadoc for this method)
 
  89          * Method declared on ASTNode.
 
  91         final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
 
  92                 // dispatch to correct overloaded match method
 
  93                 return matcher.match(this, other);
 
  96         /* (omit javadoc for this method)
 
  97          * Method declared on ASTNode.
 
  99         void accept0(ASTVisitor visitor) {
 
 101                 visitor.endVisit(this);
 
 104         /* (omit javadoc for this method)
 
 105          * Method declared on ASTNode.
 
 108                 return BASE_NODE_SIZE;
 
 111         /* (omit javadoc for this method)
 
 112          * Method declared on ASTNode.