public class ResourceFactoryRegistryImpl extends java.lang.Object implements Resource.Factory.Registry
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<?,?> |
CONTENT_DESCRIPTION_OPTIONS
A constant read only map of
options used to request just the content type . |
protected static java.util.Set<java.lang.String> |
CONTENT_TYPE_REQUESTED_PROPERTIES
A constant read only set containing just the
content type property . |
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.
|
DEFAULT_CONTENT_TYPE_IDENTIFIER, DEFAULT_EXTENSION, INSTANCE
Constructor and Description |
---|
ResourceFactoryRegistryImpl()
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
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()
|
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()
|
protected URIConverter |
getURIConverter()
Returns the URI converter that's used to
compute the content type identifier. |
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.Set<java.lang.String> CONTENT_TYPE_REQUESTED_PROPERTIES
content type property
.protected static final java.util.Map<?,?> CONTENT_DESCRIPTION_OPTIONS
options
used to request just the content type
.public ResourceFactoryRegistryImpl()
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.Registry
uri
- 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.Registry
uri
- 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.Registry
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.
getExtensionToFactoryMap
in interface Resource.Factory.Registry
Resource.Factory.Registry.DEFAULT_EXTENSION
public java.util.Map<java.lang.String,java.lang.Object> getProtocolToFactoryMap()
Resource.Factory.Registry
getProtocolToFactoryMap
in interface Resource.Factory.Registry
public java.util.Map<java.lang.String,java.lang.Object> getContentTypeToFactoryMap()
Resource.Factory.Registry
Resource.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.Registry
Resource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER