java.lang.Object
org.eclipse.core.expressions.PropertyTester
- All Implemented Interfaces:
- IPropertyTester
- public abstract class PropertyTester
- extends java.lang.Object
- implements IPropertyTester
Abstract superclass of all property testers. Implementation classes of
the extension point org.eclipse.core.expresssions.propertyTesters
must extend PropertyTester.
A property tester implements the property tests enumerated in the property
tester extension point. For the following property test extension
<propertyTester
namespace="org.eclipse.jdt.core"
id="org.eclipse.jdt.core.IPackageFragmentTester"
properties="isDefaultPackage"
type="org.eclipse.jdt.core.IPackageFragment"
class="org.eclipse.demo.MyPackageFragmentTester">
</propertyTester>
the corresponding implemenation class looks like:
public class MyPackageFragmentTester {
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
IPackageFragment fragement= (IPackageFragment)receiver;
if ("isDefaultPackage".equals(method)) {
return fragement.isDefaultPackage();
}
Assert.isTrue(false);
return false;
}
}
The property can then be used in a test expression as follows:
<instanceof value="org.eclipse.core.IPackageFragment"/>
<test property="org.eclipse.jdt.core.isDefaultPackage"/>
- Since:
- 3.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fConfigElement
private org.eclipse.core.runtime.IConfigurationElement fConfigElement
fNamespace
private java.lang.String fNamespace
fProperties
private java.lang.String fProperties
PropertyTester
public PropertyTester()
internalInitialize
public final void internalInitialize(org.eclipse.core.internal.expressions.PropertyTesterDescriptor descriptor)
- Initialize the property tester with the given name space and property.
Note: this method is for internal use only. Clients must not call
this method.
internalCreateDescriptor
public final org.eclipse.core.internal.expressions.PropertyTesterDescriptor internalCreateDescriptor()
- Note: this method is for internal use only. Clients must not call
this method.
handles
public final boolean handles(java.lang.String namespace,
java.lang.String property)
- null
- Specified by:
handles in interface IPropertyTester
isInstantiated
public final boolean isInstantiated()
- null
- Specified by:
isInstantiated in interface IPropertyTester
isDeclaringPluginActive
public boolean isDeclaringPluginActive()
- null
- Specified by:
isDeclaringPluginActive in interface IPropertyTester
instantiate
public final IPropertyTester instantiate()
- null
- Specified by:
instantiate in interface IPropertyTester