|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A registry of resource factories.
A registry implementation will typically delegate to the global instance, which can be used as follows
Resource.Factory.Registry.INSTANCE
.getProtocolToFactoryMap().
put("abc", resourceFactoryForURIWithAbcProtocol);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().
put("xyz", resourceFactoryForURIWithXyzFileExtension);
A descriptor
can be used in place of an actual factory
as a value in the map.
It is used for factories registered via
plugin registration
to ensure delayed plugin load.
ResourceSet.getResourceFactoryRegistry()
Field Summary | |
static String |
DEFAULT_EXTENSION
The file extension "*" that matches any extension. |
static Resource.Factory.Registry |
INSTANCE
The global static resource factory registry. |
Method Summary | |
Map |
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. |
Map |
getProtocolToFactoryMap()
Returns a map from protocol to
Resource.Factory
or Resource.Factory.Descriptor . |
Field Detail |
public static final String DEFAULT_EXTENSION
"*"
that matches any extension.
getExtensionToFactoryMap()
,
Constant Field Valuespublic static final Resource.Factory.Registry INSTANCE
use
by any resource set.
ResourceSet.createResource(URI)
,
ResourceSet.getResourceFactoryRegistry()
Method Detail |
public Resource.Factory getFactory(URI uri)
An implementation will (typically) use
the URI's scheme
to search the protocol
map
and the URI's file extension
to search extension
map.
It will convert
a resulting descriptor into a factory.
It may choose to provide additional mechanisms and algorithms to determine a factory appropriate for the given URI.
uri
- the URI.
ResourceSet.createResource(URI)
public Map getProtocolToFactoryMap()
protocol
to
Resource.Factory
or Resource.Factory.Descriptor
.
public Map getExtensionToFactoryMap()
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.
DEFAULT_EXTENSION
|
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 |