Class ResourceRegistry
java.lang.Object
de.uni_hildesheim.sse.vil.expressions.ResourceRegistry
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clears the registry.static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistrygetTypeRegistry(URI uri) Registers a type registry for a given resource (via its URI).static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistrygetTypeRegistry(org.eclipse.emf.common.util.URI uri) Returns the type registry for a given URI.static net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistrygetTypeRegistry(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.TypeRegistrygetTypeRegistry(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.TypeRegistrygetTypeRegistry(org.eclipse.xtext.nodemodel.INode node) Returns the type registry for a given (parse tree) node (via its resource URI).static voidregister(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 voidregister(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 voidunregister(org.eclipse.emf.common.util.URI uri) Unregisters the type registry for a given URI.static voidunregister(org.eclipse.emf.ecore.resource.Resource resource) Unregisters the type registry for a given resource (via its URI).
-
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 ifuriis not null and the givenregistryis notTypeRegistry.DEFAULT.- Parameters:
uri- the URI to register theregistryforregistry- 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 ifresource(and its URI) are not null and the givenregistryis notTypeRegistry.DEFAULT.- Parameters:
registry- the registry to be registereduri- the URI to register theregistryfor (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 ifresource(and its URI) are not null and the givenregistryis notTypeRegistry.DEFAULT.- Parameters:
uri- the URI to register theregistryfor (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.DEFAULTif 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.DEFAULTif 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.DEFAULTif 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.DEFAULTif non was registered - See Also:
-