Class XtextResourceSet

  • All Implemented Interfaces:
    org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.resource.ResourceSet
    Direct Known Subclasses:
    ResourceSetReferencingResourceSetImpl, SynchronizedXtextResourceSet

    public class XtextResourceSet
    extends org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
    A resource set that is capable of resolving classpath URIs. It maintains a ResourceSetImpl.getURIResourceMap() containing the resource's URI as well as the normalized version of it as a key. The superset of actual and normalized resource URIs must be unique within the same resource set.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  XtextResourceSet.ResourcesList
      adds the added resource to the ResourceSetImpl.getURIResourceMap().
      protected class  XtextResourceSet.UriChangeListener  
      • Nested classes/interfaces inherited from class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

        org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.MappedResourceLocator, org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.ResourceLocator, org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.ResourcesEList<E extends java.lang.Object & org.eclipse.emf.ecore.resource.Resource>
      • Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

        org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<org.eclipse.emf.common.util.URI,​org.eclipse.emf.common.util.URI> normalizationMap  
      • Fields inherited from class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

        adapterFactories, loadOptions, packageRegistry, resourceFactoryRegistry, resourceLocator, resources, uriConverter, uriResourceMap
      • Fields inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl

        eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
      • Fields inherited from interface org.eclipse.emf.ecore.resource.ResourceSet

        RESOURCE_SET__RESOURCES
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLoadOption​(java.lang.Object key, java.lang.Object value)  
      protected java.util.Map<?,​?> addTimeout​(java.util.Map<?,​?> options)
      returns a copy of the given map containing a timeout of 500ms if the given option map did not already specify a URIConverter.OPTION_TIMEOUT
      protected XtextResourceSet.ResourcesList createResourceList()
      Create the concrete list that will contain the resources.
      java.lang.Object getClasspathURIContext()  
      IClasspathUriResolver getClasspathUriResolver()  
      int getModificationStamp()  
      java.util.Map<org.eclipse.emf.common.util.URI,​org.eclipse.emf.common.util.URI> getNormalizationMap()  
      org.eclipse.emf.ecore.resource.Resource getResource​(org.eclipse.emf.common.util.URI uri, boolean loadOnDemand)  
      protected XtextResourceSet.UriChangeListener getUriChangeListener()  
      org.eclipse.emf.ecore.resource.URIConverter getURIConverter()  
      protected void initializeDefaultLoadOptions()
      Adds a XtextPlatformResourceURIHandler to the default load options of this resource set.
      boolean isOutdated()  
      void markOutdated()  
      void markSynced()  
      protected void registerURI​(org.eclipse.emf.ecore.resource.Resource resource)  
      void removeLoadOption​(java.lang.Object key)  
      void setClasspathURIContext​(java.lang.Object classpathURIContext)  
      void setClasspathUriResolver​(IClasspathUriResolver resolver)  
      • Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

        createResource, createResource, delegatedGetResource, demandCreateResource, demandLoad, demandLoadHelper, getAdapterFactories, getAllContents, getEObject, getLoadOptions, getPackageRegistry, getResourceFactoryRegistry, getResources, getURIResourceMap, handleDemandLoadException, setPackageRegistry, setResourceFactoryRegistry, setURIConverter, setURIResourceMap, toString
      • Methods inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl

        eAdapters, eBasicAdapters, eDeliver, eSetDeliver
      • Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

        eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.emf.common.notify.Notifier

        eAdapters, eDeliver, eNotify, eSetDeliver
    • Field Detail

      • normalizationMap

        protected java.util.Map<org.eclipse.emf.common.util.URI,​org.eclipse.emf.common.util.URI> normalizationMap
        Since:
        2.7
    • Constructor Detail

      • XtextResourceSet

        public XtextResourceSet()
    • Method Detail

      • getNormalizationMap

        public java.util.Map<org.eclipse.emf.common.util.URI,​org.eclipse.emf.common.util.URI> getNormalizationMap()
        Since:
        2.7
      • markOutdated

        public void markOutdated()
        Since:
        2.8
      • markSynced

        public void markSynced()
        Since:
        2.8
      • isOutdated

        public boolean isOutdated()
        Since:
        2.8
      • getModificationStamp

        public int getModificationStamp()
        Since:
        2.8
      • registerURI

        protected void registerURI​(org.eclipse.emf.ecore.resource.Resource resource)
        Since:
        2.3
      • initializeDefaultLoadOptions

        protected void initializeDefaultLoadOptions()
        Adds a XtextPlatformResourceURIHandler to the default load options of this resource set. Clients who don't want this behavior can override this method.
        Since:
        2.4
      • createResourceList

        protected XtextResourceSet.ResourcesList createResourceList()
        Create the concrete list that will contain the resources.
        Since:
        2.4
      • addLoadOption

        public void addLoadOption​(java.lang.Object key,
                                  java.lang.Object value)
      • removeLoadOption

        public void removeLoadOption​(java.lang.Object key)
      • getResource

        public org.eclipse.emf.ecore.resource.Resource getResource​(org.eclipse.emf.common.util.URI uri,
                                                                   boolean loadOnDemand)
        Specified by:
        getResource in interface org.eclipse.emf.ecore.resource.ResourceSet
        Overrides:
        getResource in class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
      • getURIConverter

        public org.eclipse.emf.ecore.resource.URIConverter getURIConverter()
        Specified by:
        getURIConverter in interface org.eclipse.emf.ecore.resource.ResourceSet
        Overrides:
        getURIConverter in class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
      • addTimeout

        protected java.util.Map<?,​?> addTimeout​(java.util.Map<?,​?> options)
        returns a copy of the given map containing a timeout of 500ms if the given option map did not already specify a URIConverter.OPTION_TIMEOUT
        Since:
        2.4
      • getClasspathURIContext

        public java.lang.Object getClasspathURIContext()
      • setClasspathURIContext

        public void setClasspathURIContext​(java.lang.Object classpathURIContext)