org.eclipse.xtext.resource.impl
Class ResourceServiceProviderRegistryImpl

java.lang.Object
  extended by org.eclipse.xtext.resource.impl.ResourceServiceProviderRegistryImpl
All Implemented Interfaces:
IResourceServiceProvider.Registry

public class ResourceServiceProviderRegistryImpl
extends java.lang.Object
implements IResourceServiceProvider.Registry

Author:
Sebastian Zarnekow - Initial contribution and API, Sven Efftinge

Nested Class Summary
static class ResourceServiceProviderRegistryImpl.InternalData
           
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.resource.IResourceServiceProvider.Registry
IResourceServiceProvider.Registry.RegistryProvider
 
Field Summary
 
Fields inherited from interface org.eclipse.xtext.resource.IResourceServiceProvider.Registry
INSTANCE
 
Constructor Summary
ResourceServiceProviderRegistryImpl()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getContentTypeToFactoryMap()
           
 java.util.Map<java.lang.String,java.lang.Object> getExtensionToFactoryMap()
           
 java.util.Map<java.lang.String,java.lang.Object> getProtocolToFactoryMap()
           
 IResourceServiceProvider getResourceServiceProvider(org.eclipse.emf.common.util.URI uri)
          Returns the resource factory appropriate for the given URI.
 IResourceServiceProvider getResourceServiceProvider(org.eclipse.emf.common.util.URI uri, java.lang.String contentType)
          Returns the IResourceServiceProvider appropriate for the given URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceServiceProviderRegistryImpl

public ResourceServiceProviderRegistryImpl()
Method Detail

getResourceServiceProvider

public IResourceServiceProvider getResourceServiceProvider(org.eclipse.emf.common.util.URI uri,
                                                           java.lang.String contentType)
Description copied from interface: IResourceServiceProvider.Registry
Returns the IResourceServiceProvider appropriate for the given URI. Content types are not yet supported.

Specified by:
getResourceServiceProvider in interface IResourceServiceProvider.Registry
Parameters:
uri - the URI.
contentType - the content type of the URI or null if a content type should not be used during lookup.
Returns:
the IResourceServiceProvider appropriate for the given URI, or null if there isn't one.

getContentTypeToFactoryMap

public java.util.Map<java.lang.String,java.lang.Object> getContentTypeToFactoryMap()
Specified by:
getContentTypeToFactoryMap in interface IResourceServiceProvider.Registry

getExtensionToFactoryMap

public java.util.Map<java.lang.String,java.lang.Object> getExtensionToFactoryMap()
Specified by:
getExtensionToFactoryMap in interface IResourceServiceProvider.Registry

getProtocolToFactoryMap

public java.util.Map<java.lang.String,java.lang.Object> getProtocolToFactoryMap()
Specified by:
getProtocolToFactoryMap in interface IResourceServiceProvider.Registry

getResourceServiceProvider

public IResourceServiceProvider getResourceServiceProvider(org.eclipse.emf.common.util.URI uri)
Description copied from interface: IResourceServiceProvider.Registry
Returns the resource factory appropriate for the given URI.

An implementation will (typically) use the URI's scheme to search the protocol map the URI's file extension to search extension map, and the URI's content type identifier to search the content type map.

Specified by:
getResourceServiceProvider in interface IResourceServiceProvider.Registry
Parameters:
uri - the URI.
Returns:
the IResourceServiceProvider appropriate for the given URI, or null if there isn't one.