Class ResourceRegistry
- java.lang.Object
-
- de.uni_hildesheim.sse.vil.expressions.ResourceRegistry
-
public class ResourceRegistry extends java.lang.ObjectRegisters 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 java.util.Map<org.eclipse.emf.common.util.URI,TypeRegistry>MAP
-
Constructor Summary
Constructors Modifier Constructor Description privateResourceRegistry()Prevents external object creation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclear()Clears the registry.static TypeRegistrygetTypeRegistry(java.net.URI uri)Registers a type registry for a given resource (via its URI).static TypeRegistrygetTypeRegistry(org.eclipse.emf.common.util.URI uri)Returns the type registry for a given URI.static TypeRegistrygetTypeRegistry(org.eclipse.emf.ecore.EObject object)Returns the type registry for a given (grammar tree) EObject (via its resource URI).static TypeRegistrygetTypeRegistry(org.eclipse.emf.ecore.resource.Resource resource)Returns the type registry for a given resource (via its URI).static 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, TypeRegistry registry)Registers a type registry for a given URI.static voidregister(org.eclipse.emf.ecore.resource.Resource resource, 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 Detail
-
MAP
private static final java.util.Map<org.eclipse.emf.common.util.URI,TypeRegistry> MAP
-
-
Method Detail
-
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:
unregister(URI)
-
register
public static void register(org.eclipse.emf.common.util.URI uri, 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, 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:
uri- the URI to register theregistryfor (may be null)registry- the registry to be registered
-
getTypeRegistry
public static TypeRegistry getTypeRegistry(java.net.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 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 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(URI)
-
getTypeRegistry
public static 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(EObject)
-
getTypeRegistry
public static 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:
getTypeRegistry(Resource)
-
-