KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > expressions > IPropertyTester


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.expressions;
12
13 import org.eclipse.core.runtime.CoreException;
14
15 /**
16  * A property tester can be used to add additional properties to test to an
17  * existing type.
18  * <p>
19  * This interface is not intended to be implemented by clients. Clients
20  * should subclass type <code>PropertyTester</code>.
21  * </p>
22  *
23  * @since 3.0
24  */

25 public interface IPropertyTester {
26
27     /**
28      * Returns whether the property tester can handle the given
29      * property or not.
30      *
31      * @param namespace the name space to be considered
32      * @param property the property to test
33      * @return <code>true</code> if the tester provides an implementation
34      * for the given property; otherwise <code>false</code> is returned
35      */

36     public boolean handles(String JavaDoc namespace, String JavaDoc property);
37     
38     /**
39      * Returns whether the implementation class for this property tester is
40      * loaded or not.
41      *
42      * @return <code>true</code>if the implementation class is loaded;
43      * <code>false</code> otherwise
44      */

45     public boolean isInstantiated();
46     
47     /**
48      * Returns <code>true</code> if the implementation class of this property
49      * tester can be loaded. This is the case if the plug-in providing
50      * the implementation class is active. Returns <code>false</code> otherwise.
51      *
52      * @return whether the implementation class can be loaded or not
53      */

54     public boolean isDeclaringPluginActive();
55     
56     /**
57      * Loads the implementation class for this property tester and returns an
58      * instance of this class.
59      *
60      * @return an instance of the implementation class for this property tester
61      *
62      * @throws CoreException if the implementation class cannot be loaded
63      */

64     public IPropertyTester instantiate() throws CoreException;
65     
66     /**
67      * Executes the property test determined by the parameter <code>property</code>.
68      *
69      * @param receiver the receiver of the property test
70      * @param property the property to test
71      * @param args additional arguments to evaluate the property. If no arguments
72      * are specified in the <code>test</code> expression an array of length 0
73      * is passed
74      * @param expectedValue the expected value of the property. The value is either
75      * of type <code>java.lang.String</code> or a boxed base type. If no value was
76      * specified in the <code>test</code> expressions then <code>null</code> is passed
77      *
78      * @return returns <code>true<code> if the property is equal to the expected value;
79      * otherwise <code>false</code> is returned
80      */

81     public boolean test(Object JavaDoc receiver, String JavaDoc property, Object JavaDoc[] args, Object JavaDoc expectedValue);
82 }
83
Popular Tags