Class ResourceRegistry

java.lang.Object
de.uni_hildesheim.sse.vil.expressions.ResourceRegistry

public class ResourceRegistry extends Object
Registers type registries for resource (URIs). This allows the UI parts of xText editors to access to correct type registry.
Author:
Holger Eichelberger
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Map<org.eclipse.emf.common.util.URI,net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Prevents external object creation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Clears the registry.
    static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry
    Registers a type registry for a given resource (via its URI).
    static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry
    getTypeRegistry(org.eclipse.emf.common.util.URI uri)
    Returns the type registry for a given URI.
    static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry
    getTypeRegistry(org.eclipse.emf.ecore.EObject object)
    Returns the type registry for a given (grammar tree) EObject (via its resource URI).
    static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry
    getTypeRegistry(org.eclipse.emf.ecore.resource.Resource resource)
    Returns the type registry for a given resource (via its URI).
    static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry
    getTypeRegistry(org.eclipse.xtext.nodemodel.INode node)
    Returns the type registry for a given (parse tree) node (via its resource URI).
    static void
    register(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry registry)
    Registers a type registry for a given URI.
    static void
    register(org.eclipse.emf.ecore.resource.Resource resource, net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry registry)
    Registers a type registry for a given resource (via its URI).
    static void
    unregister(org.eclipse.emf.common.util.URI uri)
    Unregisters the type registry for a given URI.
    static void
    unregister(org.eclipse.emf.ecore.resource.Resource resource)
    Unregisters the type registry for a given resource (via its URI).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAP

      private static final Map<org.eclipse.emf.common.util.URI,net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry> MAP
  • Constructor Details

    • ResourceRegistry

      private ResourceRegistry()
      Prevents external object creation.
  • Method Details

    • clear

      public static void clear()
      Clears the registry.
    • unregister

      public static void unregister(org.eclipse.emf.common.util.URI uri)
      Unregisters the type registry for a given URI.
      Parameters:
      uri - the URI (may be null)
    • unregister

      public static void unregister(org.eclipse.emf.ecore.resource.Resource resource)
      Unregisters the type registry for a given resource (via its URI).
      Parameters:
      resource - the resource (may be null)
      See Also:
    • register

      public static void register(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry registry)
      Registers a type registry for a given URI. Registration happens only if uri is not null and the given registry is not TypeRegistry.DEFAULT.
      Parameters:
      uri - the URI to register the registry for
      registry - the registry to be registered
    • register

      public static void register(org.eclipse.emf.ecore.resource.Resource resource, net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry registry)
      Registers a type registry for a given resource (via its URI). Registration happens only if resource (and its URI) are not null and the given registry is not TypeRegistry.DEFAULT.
      Parameters:
      registry - the registry to be registered
      uri - the URI to register the registry for (may be null)
    • getTypeRegistry

      public static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry getTypeRegistry(URI uri)
      Registers a type registry for a given resource (via its URI). Registration happens only if resource (and its URI) are not null and the given registry is not TypeRegistry.DEFAULT.
      Parameters:
      uri - the URI to register the registry for (may be null)
      registry - the registry to be registered
    • getTypeRegistry

      public static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry getTypeRegistry(org.eclipse.emf.common.util.URI uri)
      Returns the type registry for a given URI.
      Parameters:
      uri - the URL the type registry shall be returned for (may be null)
      Returns:
      the related type registry or TypeRegistry.DEFAULT if non was registered
    • getTypeRegistry

      public static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry getTypeRegistry(org.eclipse.emf.ecore.resource.Resource resource)
      Returns the type registry for a given resource (via its URI).
      Parameters:
      resource - the resource the type registry shall be returned for (may be null)
      Returns:
      the related type registry or TypeRegistry.DEFAULT if non was registered
      See Also:
    • getTypeRegistry

      public static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry getTypeRegistry(org.eclipse.xtext.nodemodel.INode node)
      Returns the type registry for a given (parse tree) node (via its resource URI).
      Parameters:
      node - the node the type registry shall be returned for (may be null)
      Returns:
      the related type registry or TypeRegistry.DEFAULT if non was registered
      See Also:
    • getTypeRegistry

      public static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry getTypeRegistry(org.eclipse.emf.ecore.EObject object)
      Returns the type registry for a given (grammar tree) EObject (via its resource URI).
      Parameters:
      object - the object the type registry shall be returned for (may be null)
      Returns:
      the related type registry or TypeRegistry.DEFAULT if non was registered
      See Also: