1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core;
13 import net.sourceforge.phpdt.core.ICompilationUnit;
14 import net.sourceforge.phpdt.core.IPackageDeclaration;
15 import net.sourceforge.phpdt.core.JavaModelException;
16 import net.sourceforge.phpdt.core.jdom.IDOMNode;
19 * @see IPackageDeclaration
22 /* package */ class PackageDeclaration extends SourceRefElement implements IPackageDeclaration {
23 protected PackageDeclaration(ICompilationUnit parent, String name) {
24 super(PACKAGE_DECLARATION, parent, name);
27 * @see JavaElement#equalsDOMNode
29 protected boolean equalsDOMNode(IDOMNode node) throws JavaModelException {
30 return (node.getNodeType() == IDOMNode.PACKAGE) && getElementName().equals(node.getName());
33 * @see JavaElement#getHandleMemento()
35 protected char getHandleMementoDelimiter() {
36 return JavaElement.JEM_PACKAGEDECLARATION;
39 * @private Debugging purposes
41 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
42 buffer.append(this.tabString(tab));
43 buffer.append("package "); //$NON-NLS-1$
44 buffer.append(getElementName());
46 buffer.append(" (not open)"); //$NON-NLS-1$