## org.eclipse.emf.ecore.resource.impl
Class ResourceFactoryRegistryImpl

    java.lang.Object
      org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl

All Implemented Interfaces:
  Resource.Factory.Registry

    public class ResourceFactoryRegistryImpl

extends java.lang.Object
implements Resource.Factory.Registry

An extensible implementation of a resource factory registry.

Field Summary
`protected java.util.Map<java.lang.String,java.lang.Object>` `extensionToFactoryMap` The extension map.
`protected java.util.Map<java.lang.String,java.lang.Object>` `protocolToFactoryMap` The protocol map.

Fields inherited from interface org.eclipse.emf.ecore.resource.Resource.Factory.Registry
`DEFAULT_EXTENSION, INSTANCE`

Constructor Summary
`ResourceFactoryRegistryImpl()` Creates an instance.

Method Summary
`protected Resource.Factory` `delegatedGetFactory(URI uri)` Returns the resource factory appropriate for the given URI, when standard alternatives fail.
`java.util.Map<java.lang.String,java.lang.Object>` `getExtensionToFactoryMap()` Returns a map from `file extension` to `Resource.Factory` or `Resource.Factory.Descriptor`.
`Resource.Factory` `getFactory(URI uri)` Returns the resource factory appropriate for the given URI.
`java.util.Map<java.lang.String,java.lang.Object>` `getProtocolToFactoryMap()` Returns a map from `protocol` to `Resource.Factory` or `Resource.Factory.Descriptor`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### protocolToFactoryMap

    protected java.util.Map<java.lang.String,java.lang.Object> protocolToFactoryMap

  The protocol map.

### extensionToFactoryMap

    protected java.util.Map<java.lang.String,java.lang.Object> extensionToFactoryMap

  The extension map.

Constructor Detail

### ResourceFactoryRegistryImpl

    public ResourceFactoryRegistryImpl()

  Creates an instance.

Method Detail

### getFactory

    public Resource.Factory getFactory(URI uri)

  Returns the resource factory appropriate for the given URI.

  This implementation does the `typical` thing. It will delegate to `delegatedGetFactory(URI)` in the case that the typical behaviour doesn't produce a result; clients are encouraged to override that method only.

  Specified by:
    `getFactory` in interface `Resource.Factory.Registry`
  Parameters:
    `uri` - the URI.
  Returns:
    the resource factory appropriate for the given URI.
  See Also:
    `ResourceSet.createResource(URI)`

### delegatedGetFactory

    protected Resource.Factory delegatedGetFactory(URI uri)

  Returns the resource factory appropriate for the given URI, when standard alternatives fail.

  This implementation returns `null`; clients are encouraged to override it.

  Parameters:
    `uri` - the URI.
  Returns:
    the resource factory appropriate for the given URI.
  See Also:
    `getFactory(URI)`

### getExtensionToFactoryMap

    public java.util.Map<java.lang.String,java.lang.Object> getExtensionToFactoryMap()

  Description copied from interface: `Resource.Factory.Registry`
  Returns a map from `file extension` to `Resource.Factory` or `Resource.Factory.Descriptor`.

  The `default` file extension `"*"` can be registered as a default that matches any file extension. This is typically reserved for a default factory that supports XMI serialization; clients are strongly discouraged from using this feature in the global registry, particularly those that must function effectively within an Eclipse environment.

  Specified by:
    `getExtensionToFactoryMap` in interface `Resource.Factory.Registry`
  Returns:
    the file extension map.
  See Also:
    `Resource.Factory.Registry.DEFAULT_EXTENSION`

### getProtocolToFactoryMap

    public java.util.Map<java.lang.String,java.lang.Object> getProtocolToFactoryMap()

  Description copied from interface: `Resource.Factory.Registry`
  Returns a map from `protocol` to `Resource.Factory` or `Resource.Factory.Descriptor`.

  Specified by:
    `getProtocolToFactoryMap` in interface `Resource.Factory.Registry`
  Returns:
    the protocol map.

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