|
|
|
|
org.eclipse.core.runtime.content
Interface IContentDescriber
-
All Known Subinterfaces:
-
ITextContentDescriber
-
All Known Implementing Classes:
-
BinarySignatureDescriber, org.eclipse.core.internal.content.TextContentDescriber,
XMLContentDescriber,
XMLRootElementContentDescriber,
XMLRootElementContentDescriber2
-
public interface IContentDescriber
Content describers know how to retrieve metadata from
contents.
Note: It is expected that content describer implementations be declared in a package
that is exempt from plug-in activation (using the Eclipse-AutoStart bundle
manifest header). Since all describers are instantiated when the content type
framework is initialized, failure in complying with this requirement causes
premature activation, which must be avoided. Future implementations of the
framework might refuse to instantiate describers if doing so would trigger
activation of the corresponding plug-in.
Describers for text-based content types should implement
ITextContentDescriber instead.
Clients may implement this interface.
-
Since:
- 3.0
-
See Also:
-
IContentDescription
Field Summary
|
static int
|
INDETERMINATE
Description result constant, indicating that it was not possible
to determine whether the contents were valid for
the intended content type. |
static int
|
INVALID
Description result constant, indicating the contents are invalid for
the intended content type. |
static int
|
VALID
Description result constant, indicating the contents are valid for
the intended content type. |
INDETERMINATE
static final int INDETERMINATE
- Description result constant, indicating that it was not possible
to determine whether the contents were valid for
the intended content type.
-
See Also:
-
describe(java.io.InputStream, org.eclipse.core.runtime.content.IContentDescription) ,
Constant Field Values
INVALID
static final int INVALID
- Description result constant, indicating the contents are invalid for
the intended content type.
-
See Also:
-
describe(java.io.InputStream, org.eclipse.core.runtime.content.IContentDescription) ,
Constant Field Values
VALID
static final int VALID
- Description result constant, indicating the contents are valid for
the intended content type.
-
See Also:
-
describe(java.io.InputStream, org.eclipse.core.runtime.content.IContentDescription) ,
Constant Field Values
describe
int describe(
InputStream contents,
IContentDescription description)
throws
IOException
- Tries to fill a description for the given contents. Returns
an
int indicating whether the given stream of
bytes represents a valid sample for its corresponding content type.
If no content description is provided, this method should perform
content type validation.
The input stream must be kept open, and any IOExceptions while
reading the stream should flow to the caller.
-
-
Parameters:
-
contents - the contents to be examined -
description - a description to be filled in, or null if
only content type validation is to be performed
-
Returns:
- one of the following:
-
VALID
,
-
INVALID
,
-
INDETERMINATE
-
Throws:
-
IOException
- if an I/O error occurs -
See Also:
-
IContentDescription ,
VALID ,
INVALID ,
INDETERMINATE
getSupportedOptions
QualifiedName[] getSupportedOptions()
- Returns the properties supported by this describer.
-
-
Returns:
- the supported properties
-
See Also:
-
describe(java.io.InputStream, org.eclipse.core.runtime.content.IContentDescription)
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.
|
|
|