KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > search > matching > PackageDeclarationPattern


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 package org.eclipse.jdt.internal.core.search.matching;
12
13 import org.eclipse.jdt.internal.core.index.*;
14
15 public class PackageDeclarationPattern extends JavaSearchPattern {
16
17 protected char[] pkgName;
18
19 public PackageDeclarationPattern(char[] pkgName, int matchRule) {
20     super(PKG_DECL_PATTERN, matchRule);
21     this.pkgName = pkgName;
22 }
23 EntryResult[] queryIn(Index index) {
24     // package declarations are not indexed
25
return null;
26 }
27 protected StringBuffer JavaDoc print(StringBuffer JavaDoc output) {
28     output.append("PackageDeclarationPattern: <"); //$NON-NLS-1$
29
if (this.pkgName != null)
30         output.append(this.pkgName);
31     else
32         output.append("*"); //$NON-NLS-1$
33
output.append(">"); //$NON-NLS-1$
34
return super.print(output);
35 }
36 }
37
Popular Tags