com.ibm.etools.emf.resource
Class ResourceFactoryRegister

java.lang.Object
  |
  +--com.ibm.etools.emf.resource.ResourceFactoryRegister

public class ResourceFactoryRegister
extends java.lang.Object

Obtain a resource factory based on a URI; you can register your own resource factory based on the protocol or extension of the URI, so your resources will be created. The scheme of the URI is checked first, followed by the extension.


Field Summary
static java.lang.String copyright
           
 
Method Summary
static ResourceFactory createFactoryFromPreRegister(java.lang.String key, int resourceType)
          Create the resource factory if found in the pre-register hash data
static com.ibm.etools.emf.resource.ContextFactory getContextFactory()
          Get a context factory.
static com.ibm.etools.emf.resource.ContextResourceFactoryRegister getDefaultResourceFactoryRegister()
          returns the default resource factory register, this one acts as the singleton ResourceFactoryRegsiter
static ResourceFactory getFactory(java.lang.String uri)
          If a resource factory has been registered for the scheme of the given URI, return it; otherwise, return a resource factory that has been registered for the extension of the URI.
static ResourceFactory getFactory(java.lang.String uri, ResourceSet rs)
          If a resource factory has been registered for the scheme of the given URI, return it; otherwise, return a resource factory that has been registered for the extension of the URI.
static ResourceFactory getFileFactory(java.lang.String fileName)
           
static java.util.Collection getProtocols()
          Get the protocols.
static com.ibm.etools.emf.resource.ResourceSetFactory getResourceSetFactory()
          Get a resource set factory.
static void initialize()
           
static void preRegisterExtension(java.lang.String key, com.ibm.etools.emf.plugin.IConfigurationClassDescriptor desc)
          Register your resource factory that creates resources that can handle URIs with the given extension.
static void preRegisterFile(java.lang.String key, com.ibm.etools.emf.plugin.IConfigurationClassDescriptor desc)
          Pre-register your resource factory that creates resources that can handle URIs with the given file name.
static void preRegisterProtocol(java.lang.String key, com.ibm.etools.emf.plugin.IConfigurationClassDescriptor desc)
          Register your resource factory that creates resources that can handle URIs with the given protocol.
static void registerContextFactory(com.ibm.etools.emf.resource.ContextFactory f)
          Register a context factory
static void registerExtension(java.lang.String extension, ResourceFactory rf)
          Register your resource factory that creates resources that can handle URIs that end with the given extension.
static void registerFile(java.lang.String fileName, ResourceFactory rf)
          Register your resource factory that creates resources that can handle URIs with the given file name.
static void registerProtocol(java.lang.String protocol, ResourceFactory rf)
          Register your resource factory that creates resources that can handle URIs with the given protocol.
static void registerResourceSetFactory(com.ibm.etools.emf.resource.ResourceSetFactory f)
          Register a resource set factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Method Detail

getDefaultResourceFactoryRegister

public static com.ibm.etools.emf.resource.ContextResourceFactoryRegister getDefaultResourceFactoryRegister()
returns the default resource factory register, this one acts as the singleton ResourceFactoryRegsiter

getFactory

public static ResourceFactory getFactory(java.lang.String uri)
If a resource factory has been registered for the scheme of the given URI, return it; otherwise, return a resource factory that has been registered for the extension of the URI.

getFactory

public static ResourceFactory getFactory(java.lang.String uri,
                                         ResourceSet rs)
If a resource factory has been registered for the scheme of the given URI, return it; otherwise, return a resource factory that has been registered for the extension of the URI.

registerExtension

public static void registerExtension(java.lang.String extension,
                                     ResourceFactory rf)
Register your resource factory that creates resources that can handle URIs that end with the given extension.

registerFile

public static void registerFile(java.lang.String fileName,
                                ResourceFactory rf)
Register your resource factory that creates resources that can handle URIs with the given file name.

registerProtocol

public static void registerProtocol(java.lang.String protocol,
                                    ResourceFactory rf)
Register your resource factory that creates resources that can handle URIs with the given protocol.

preRegisterFile

public static void preRegisterFile(java.lang.String key,
                                   com.ibm.etools.emf.plugin.IConfigurationClassDescriptor desc)
Pre-register your resource factory that creates resources that can handle URIs with the given file name.

preRegisterProtocol

public static void preRegisterProtocol(java.lang.String key,
                                       com.ibm.etools.emf.plugin.IConfigurationClassDescriptor desc)
Register your resource factory that creates resources that can handle URIs with the given protocol.

preRegisterExtension

public static void preRegisterExtension(java.lang.String key,
                                        com.ibm.etools.emf.plugin.IConfigurationClassDescriptor desc)
Register your resource factory that creates resources that can handle URIs with the given extension.

createFactoryFromPreRegister

public static ResourceFactory createFactoryFromPreRegister(java.lang.String key,
                                                           int resourceType)
Create the resource factory if found in the pre-register hash data

getProtocols

public static java.util.Collection getProtocols()
Get the protocols.

getContextFactory

public static com.ibm.etools.emf.resource.ContextFactory getContextFactory()
Get a context factory.

registerContextFactory

public static void registerContextFactory(com.ibm.etools.emf.resource.ContextFactory f)
Register a context factory

getResourceSetFactory

public static com.ibm.etools.emf.resource.ResourceSetFactory getResourceSetFactory()
Get a resource set factory.

registerResourceSetFactory

public static void registerResourceSetFactory(com.ibm.etools.emf.resource.ResourceSetFactory f)
Register a resource set factory

initialize

public static void initialize()

getFileFactory

public static ResourceFactory getFileFactory(java.lang.String fileName)