KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > properties > IVisitor


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.core.internal.properties;
12
13 import org.eclipse.core.internal.indexing.IndexCursor;
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.core.runtime.QualifiedName;
16
17 /* package */interface IVisitor {
18     /**
19      * Answers whether the visitor requires that the <code>IStoredProperty</code>
20      * has its value filled when matched from the store.
21      * <p>
22      * Retrieving the property value may be expensive in time and memory usage
23      * (dependent upon the size of the property value.)</p>
24      * <p>
25      * If the visitor answers true, the <code>visit()</code> method will be
26      * invoked with a complete property; if the visitor answers false the property
27      * value will be <code>null</code>.
28      *
29      * @param resourceName the name of the matching resource
30      * @param propertyName the name of the matching property
31      * @return whether the visit method requires a value
32      */

33     public boolean requiresValue(ResourceName resourceName, QualifiedName propertyName);
34
35     /**
36      * Performs whatever actions are appropriate to the visitor when a
37      * match is made to the property store query.
38      * <p>
39      * This method is invoked each time a matching entry is found in the store.</p>
40      * <p>
41      * Note that the property will have a <code>null</code> value if the <code>
42      * requiresValue()</code> method returned <code>false</code> for this property.
43      *
44      * @see IndexCursor
45      * @param resourceName the matching resource.
46      * @param property the matching property.
47      * @param cursor the cursor positioned at this property in the <code>IndexStore</code>.
48      */

49     public void visit(ResourceName resourceName, StoredProperty property, IndexCursor cursor) throws CoreException;
50 }
51
Popular Tags