KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > util > TypeInfoRequestor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.corext.util;
12
13 import java.util.Collection JavaDoc;
14
15 import org.eclipse.jface.util.Assert;
16
17 import org.eclipse.jdt.core.search.TypeNameRequestor;
18
19
20 public class TypeInfoRequestor extends TypeNameRequestor {
21     
22     private Collection JavaDoc fTypesFound;
23     private TypeInfoFactory fFactory;
24     
25     /**
26      * Constructs the TypeRefRequestor
27      * @param typesFound Will collect all TypeRef's found
28      */

29     public TypeInfoRequestor(Collection JavaDoc typesFound) {
30         Assert.isNotNull(typesFound);
31         fTypesFound= typesFound;
32         fFactory= new TypeInfoFactory();
33     }
34     
35     protected boolean inScope(char[] packageName, char[] typeName) {
36         return !TypeFilter.isFiltered(packageName, typeName);
37     }
38
39     public void acceptType(int modifiers, char[] packageName, char[] typeName, char[][] enclosingTypeNames, String JavaDoc path) {
40         if (inScope(packageName, typeName)) {
41             fTypesFound.add(fFactory.create(packageName, typeName, enclosingTypeNames, modifiers, path));
42         }
43     }
44 }
45
Popular Tags