org.eclipse.emf.ecore.resource.impl
Class ContentHandlerImpl.Describer

java.lang.Object
  extended by org.eclipse.emf.ecore.resource.impl.ContentHandlerImpl.Describer
All Implemented Interfaces:
IContentDescriber, ITextContentDescriber, IExecutableExtension
Direct Known Subclasses:
RootXMLContentHandlerImpl.Describer, XMLContentHandlerImpl.XMI.Describer
Enclosing class:
ContentHandlerImpl

public static class ContentHandlerImpl.Describer
extends java.lang.Object
implements IContentDescriber, ITextContentDescriber, IExecutableExtension

An implementation of a describer that delegates to a ContentHandler.


Field Summary
protected static java.lang.String CONTENT_TYPE_ID
          The key in the parameters map representing the content type identifier String.
protected  ContentHandler contentHandler
          The content handler delegate.
protected static java.lang.String EXTENSIONS
          The key in the parameters map representing the extensions, which are encoded as a space separate list of suffixes.
 
Constructor Summary
ContentHandlerImpl.Describer()
           
 
Method Summary
protected  ContentHandler createContentHandler(java.util.Map<java.lang.String,java.lang.String> parameters)
          Returns the new content handler for the given parameters that were supplied by the registration of the Eclipse content type.
 int describe(java.io.InputStream inputStream, IContentDescription description)
           
 int describe(java.io.Reader reader, IContentDescription description)
           
protected  java.lang.Object getDescriptionValue(QualifiedName qualifiedName, java.lang.Object value)
          Returns the given property's basic EMF value converted to the corresponding Eclipse value.
protected  java.util.Map<java.lang.String,java.lang.String> getParameters(IConfigurationElement configurationElement, java.lang.String propertyName, java.lang.Object data)
          Returns the map of parameters as fetched from the given configuration element's information.
protected  java.lang.String getProperty(QualifiedName qualifiedName)
          Returns the qualified name converted to the corresponding property string.
 QualifiedName[] getSupportedOptions()
          Returns the qualified names of the supported options.
 void setInitializationData(IConfigurationElement configurationElement, java.lang.String propertyName, java.lang.Object data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentHandler

protected ContentHandler contentHandler
The content handler delegate.


CONTENT_TYPE_ID

protected static final java.lang.String CONTENT_TYPE_ID
The key in the parameters map representing the content type identifier String.

See Also:
Constant Field Values

EXTENSIONS

protected static final java.lang.String EXTENSIONS
The key in the parameters map representing the extensions, which are encoded as a space separate list of suffixes.

See Also:
Constant Field Values
Constructor Detail

ContentHandlerImpl.Describer

public ContentHandlerImpl.Describer()
Method Detail

getSupportedOptions

public QualifiedName[] getSupportedOptions()
Returns the qualified names of the supported options. This base implementation supports only IContentDescription.CHARSET and IContentDescription.BYTE_ORDER_MARK.

Specified by:
getSupportedOptions in interface IContentDescriber
Returns:
the qualified names of the supported options.

getProperty

protected java.lang.String getProperty(QualifiedName qualifiedName)
Returns the qualified name converted to the corresponding property string.

Parameters:
qualifiedName - the qualified name to convert.
Returns:
the qualified name converted to the corresponding property string.

getDescriptionValue

protected java.lang.Object getDescriptionValue(QualifiedName qualifiedName,
                                               java.lang.Object value)
Returns the given property's basic EMF value converted to the corresponding Eclipse value.

Parameters:
qualifiedName - the name of the property for which this value applies.
value - the value to convert.
Returns:
the given property's basic EMF value converted to the corresponding Eclipse value.

describe

public int describe(java.io.InputStream inputStream,
                    IContentDescription description)
             throws java.io.IOException
Specified by:
describe in interface IContentDescriber
Throws:
java.io.IOException

describe

public int describe(java.io.Reader reader,
                    IContentDescription description)
             throws java.io.IOException
Specified by:
describe in interface ITextContentDescriber
Throws:
java.io.IOException

setInitializationData

public void setInitializationData(IConfigurationElement configurationElement,
                                  java.lang.String propertyName,
                                  java.lang.Object data)
                           throws CoreException
Specified by:
setInitializationData in interface IExecutableExtension
Throws:
CoreException

createContentHandler

protected ContentHandler createContentHandler(java.util.Map<java.lang.String,java.lang.String> parameters)
Returns the new content handler for the given parameters that were supplied by the registration of the Eclipse content type.

Parameters:
parameters - the parameter for configuring the content handler.
Returns:
the next content handler.

getParameters

protected java.util.Map<java.lang.String,java.lang.String> getParameters(IConfigurationElement configurationElement,
                                                                         java.lang.String propertyName,
                                                                         java.lang.Object data)
Returns the map of parameters as fetched from the given configuration element's information. This implementation populates the content type identifier and the extensions.

Parameters:
configurationElement - the configuration element of the content type.
propertyName - the property for this particular for this instance.
data - the data associated with this instance.
Returns:
the map of parameters as fetched from the given configuration element's information.

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.