Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.core.runtime.content
Interface IContentDescriber

All Known Subinterfaces:
  ITextContentDescriber

All Known Implementing Classes:
  BinarySignatureDescriber, org.eclipse.core.internal.content.TextContentDescriber, org.eclipse.core.internal.content.XMLContentDescriber

public interface IContentDescriber

Content describers know how to retrieve metadata from contents.

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.

Method Summary
`int` | `describe(InputStream contents, IContentDescription description)` Tries to fill a description for the given contents.
`QualifiedName[]` | `getSupportedOptions()` Returns the properties supported by this describer.

Field Detail

### INDETERMINATE

    public 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

    public 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

    public 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

Method Detail

### describe

    public 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

    public 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)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.