Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.runtime.content
Interface IContentDescription


public interface IContentDescription

A content description object contains information about the nature of arbitrary data.

A content description object will always include the content type for the examined contents, and may also include information on:

  1. charset;
  2. byte order mark;
  3. other custom properties provided by third-party plug-ins.

Content describers provided by plug-ins will fill in most of the properties in a content description object, except for the content type, what is done by the platform. After a content description is filled in by a content interpreter, it is marked as immutable by the platform, so calling any of the mutator methods defined in this interface will cause an IllegalStateException to be thrown.

Default values for properties can be contributed by plug-ins as part of the content type definition markup.

This interface is not intended to be implemented by clients.

Since:
3.0
See Also:
IContentDescriber

Field Summary
static  QualifiedName[] ALL
          Options constant meaning that all properties should be described.
static byte[] BOM_UTF_16BE
          Constant that identifies the Byte-Order-Mark for contents encoded with the UTF-16 Big Endian character encoding scheme.
static byte[] BOM_UTF_16LE
          Constant that identifies the Byte-Order-Mark for contents encoded with the UTF-16 Little Endian character encoding scheme.
static byte[] BOM_UTF_8
          Constant that identifies the Byte-Order-Mark for contents encoded with the UTF-8 character encoding scheme.
static  QualifiedName BYTE_ORDER_MARK
          Key for the "byte order mark" property.
static  QualifiedName CHARSET
          Key for the "charset" property.
 
Method Summary
  String getCharset ()
          Returns the charset name to be used when reading the contents described by this object.
  IContentType getContentType ()
          Returns the content type detected.
  Object getProperty ( QualifiedName key)
          Returns the value of custom property set by the content describer, or the default value for the property, if one has been defined.
 boolean isRequested ( QualifiedName key)
          Returns whether the given property is requested to be described.
 void setProperty ( QualifiedName key, Object value)
          Sets the given property to the given value.
 

Field Detail

CHARSET

static final 
QualifiedName CHARSET
Key for the "charset" property.


BYTE_ORDER_MARK

static final 
QualifiedName BYTE_ORDER_MARK
Key for the "byte order mark" property. This property is only meaningful when describing byte streams.


ALL

static final 
QualifiedName[] ALL
Options constant meaning that all properties should be described.


BOM_UTF_8

static final byte[] BOM_UTF_8
Constant that identifies the Byte-Order-Mark for contents encoded with the UTF-8 character encoding scheme.


BOM_UTF_16BE

static final byte[] BOM_UTF_16BE
Constant that identifies the Byte-Order-Mark for contents encoded with the UTF-16 Big Endian character encoding scheme.


BOM_UTF_16LE

static final byte[] BOM_UTF_16LE
Constant that identifies the Byte-Order-Mark for contents encoded with the UTF-16 Little Endian character encoding scheme.

Method Detail

isRequested

boolean isRequested(
QualifiedName key)
Returns whether the given property is requested to be described. This method is intended to allow content describers to determine which properties should be described.

Parameters:
key - a key for the property to be verified
Returns:
true if the property is to be described, false otherwise

getCharset

String getCharset()
Returns the charset name to be used when reading the contents described by this object.

If a Unicode byte order mark has been found (the BYTE_ORDER_MARK property has been set), a corresponding charset name will be returned (e.g. "UTF-8", "UTF-16"). Otherwise, the value of the CHARSET property will be returned.

Returns:
a charset name, or null

getContentType

IContentType getContentType()
Returns the content type detected. Returns null if the content type could not be determined.

Returns:
the corresponding content type, or null

getProperty

Object getProperty(
QualifiedName key)
Returns the value of custom property set by the content describer, or the default value for the property, if one has been defined.

The qualifier part of the property name must be the unique identifier of the declaring plug-in (e.g. "com.example.plugin").

Parameters:
key - the property key
Returns:
the property value, or null, if the property is not found

setProperty

void setProperty(
QualifiedName key,
                 
Object value)
Sets the given property to the given value.

The qualifier part of the property name must be the unique identifier of the declaring plug-in (e.g. "com.example.plugin").

This method should not be called by clients other than content describers. An attempt to set a property from other contexts will cause an IllegalStateException to be thrown.

Parameters:
key - the qualified name of the property
value - the property value, or null, if the property is to be removed
Throws:
IllegalStateException - if called after this description has been filled in

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire