|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl
public class ResourceFactoryRegistryImpl
An extensible implementation of a resource factory registry.
| Field Summary | |
|---|---|
protected static java.util.Map<?,?> |
CONTENT_DESCRIPTION_OPTIONS
A constant read only map of options used to request just the content type. |
protected java.util.Map<java.lang.String,java.lang.Object> |
contentTypeIdentifierToFactoryMap
The content type identifier map. |
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_CONTENT_TYPE_IDENTIFIER, DEFAULT_EXTENSION, INSTANCE |
| Constructor Summary | |
|---|---|
ResourceFactoryRegistryImpl()
Creates an instance. |
|
| Method Summary | |
|---|---|
static Resource.Factory |
convert(java.lang.Object resourceFactory)
|
protected Resource.Factory |
delegatedGetFactory(URI uri)
Deprecated. since 2.4 |
protected Resource.Factory |
delegatedGetFactory(URI uri,
java.lang.String contentTypeIdentifier)
Returns the resource factory appropriate for the given URI and content type identifier, when standard alternatives fail. |
protected java.util.Map<?,?> |
getContentDescriptionOptions()
Returns the default options used to compute the content type identifier. |
protected java.lang.String |
getContentTypeIdentifier(URI uri)
|
java.util.Map<java.lang.String,java.lang.Object> |
getContentTypeToFactoryMap()
Returns a map from content type identifier to Resource.Factory
or Resource.Factory.Descriptor. |
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. |
protected java.lang.Object |
getFactory(URI uri,
java.util.Map<java.lang.String,java.lang.Object> protocolToFactoryMap,
java.util.Map<java.lang.String,java.lang.Object> extensionToFactoryMap,
java.util.Map<java.lang.String,java.lang.Object> contentTypeIdentifierToFactoryMap,
java.lang.String contentTypeIdentifier,
boolean delegate)
|
Resource.Factory |
getFactory(URI uri,
java.lang.String contentType)
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. |
protected URIConverter |
getURIConverter()
Returns the URI converter that's used to compute the content type identifier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<java.lang.String,java.lang.Object> protocolToFactoryMap
protected java.util.Map<java.lang.String,java.lang.Object> extensionToFactoryMap
protected java.util.Map<java.lang.String,java.lang.Object> contentTypeIdentifierToFactoryMap
protected static final java.util.Map<?,?> CONTENT_DESCRIPTION_OPTIONS
options used to request just the content type.
| Constructor Detail |
|---|
public ResourceFactoryRegistryImpl()
| Method Detail |
|---|
public Resource.Factory getFactory(URI uri)
This implementation does the typical thing.
It will delegate to delegatedGetFactory(URI, String)
in the case that the typical behaviour doesn't produce a result;
clients are encouraged to override that method only.
getFactory in interface Resource.Factory.Registryuri - the URI.
ResourceSet.createResource(URI)
public Resource.Factory getFactory(URI uri,
java.lang.String contentType)
This implementation does the typical thing.
It will delegate to delegatedGetFactory(URI, String)
in the case that the typical behaviour doesn't produce a result;
clients are encouraged to override that method only.
getFactory in interface Resource.Factory.Registryuri - the URI.contentType - the content type of the URI or null if a content type should not be used during lookup.
ResourceSet.createResource(URI)public static Resource.Factory convert(java.lang.Object resourceFactory)
protected java.lang.Object getFactory(URI uri,
java.util.Map<java.lang.String,java.lang.Object> protocolToFactoryMap,
java.util.Map<java.lang.String,java.lang.Object> extensionToFactoryMap,
java.util.Map<java.lang.String,java.lang.Object> contentTypeIdentifierToFactoryMap,
java.lang.String contentTypeIdentifier,
boolean delegate)
protected java.lang.String getContentTypeIdentifier(URI uri)
protected URIConverter getURIConverter()
compute the content type identifier.
protected java.util.Map<?,?> getContentDescriptionOptions()
compute the content type identifier.
protected Resource.Factory delegatedGetFactory(URI uri,
java.lang.String contentTypeIdentifier)
content type identifier, when standard alternatives fail.
This implementation calls delegatedGetFactory(URI);
clients are encouraged to override it.
uri - the URI.contentTypeIdentifier - the content type identifier.
getFactory(URI)@Deprecated protected Resource.Factory delegatedGetFactory(URI uri)
This implementation returns null;
clients are encouraged to override delegatedGetFactory(URI, String) instead.
uri - the URI.
getFactory(URI)public java.util.Map<java.lang.String,java.lang.Object> getExtensionToFactoryMap()
Resource.Factory.Registryfile 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.
getExtensionToFactoryMap in interface Resource.Factory.RegistryResource.Factory.Registry.DEFAULT_EXTENSIONpublic java.util.Map<java.lang.String,java.lang.Object> getProtocolToFactoryMap()
Resource.Factory.Registryprotocol to
Resource.Factory
or Resource.Factory.Descriptor.
getProtocolToFactoryMap in interface Resource.Factory.Registrypublic java.util.Map<java.lang.String,java.lang.Object> getContentTypeToFactoryMap()
Resource.Factory.RegistryResource.Factory
or Resource.Factory.Descriptor.
The default content type identifier "*"
can be registered as a default that matches any content type identifier.
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.
getContentTypeToFactoryMap in interface Resource.Factory.RegistryResource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||