public class OptimizedFilePropertyTester
extends org.eclipse.core.internal.propertytester.ResourcePropertyTester
FilePropertyTester
providing an optimized
implementation for CONTENT_TYPE_ID
property tests which significantly increases runtime performance when
this kind of property test is applied to big numbers of files.Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CONTENT_TYPE_ID
A property indicating that we are looking to verify that the file matches the content type matching the given
identifier.
|
Constructor and Description |
---|
OptimizedFilePropertyTester() |
Modifier and Type | Method and Description |
---|---|
boolean |
test(java.lang.Object receiver,
java.lang.String method,
java.lang.Object[] args,
java.lang.Object expectedValue) |
protected boolean |
testContentType(org.eclipse.core.resources.IFile file,
java.lang.String contentTypeId)
Tests whether the content type for
file matches the contentTypeId . |
testProperty, toBoolean, toQualifedName, toString
protected static final java.lang.String CONTENT_TYPE_ID
public boolean test(java.lang.Object receiver, java.lang.String method, java.lang.Object[] args, java.lang.Object expectedValue)
test
in interface org.eclipse.core.expressions.IPropertyTester
test
in class org.eclipse.core.internal.propertytester.ResourcePropertyTester
protected boolean testContentType(org.eclipse.core.resources.IFile file, java.lang.String contentTypeId)
file
matches the contentTypeId
. It is possible that
this method call could cause the file to be read. It is also possible (through poor plug-in design) for this
method to load plug-ins.file
- The file for which the content type should be determined; must not be null
.contentTypeId
- The expected content type; must not be null
.true
iff the best matching content type has an identifier that matches
contentTypeId
; false
otherwise.