org.eclipse.xtext.xtext
Class GrammarResource

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.common.notify.impl.NotifierImpl
          extended by org.eclipse.emf.ecore.resource.impl.ResourceImpl
              extended by org.eclipse.xtext.resource.XtextResource
                  extended by org.eclipse.xtext.linking.lazy.LazyLinkingResource
                      extended by org.eclipse.xtext.resource.DerivedStateAwareResource
                          extended by org.eclipse.xtext.xtext.GrammarResource
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.resource.Resource.Internal

public class GrammarResource
extends DerivedStateAwareResource

Resource implementation that instantiates the infered packages as part of the derived state computation.

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
static class GrammarResource.LinkingTrigger
          Triggers the ecore inference as soon as someone wants to access the contents of a GrammarResource.
 
Nested classes/interfaces inherited from class org.eclipse.xtext.linking.lazy.LazyLinkingResource
LazyLinkingResource.DiagnosticMessageContext
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl
org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList<E extends java.lang.Object & org.eclipse.emf.ecore.EObject>, org.eclipse.emf.ecore.resource.impl.ResourceImpl.ModificationTrackingAdapter
 
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>
 
Field Summary
 
Fields inherited from class org.eclipse.xtext.resource.DerivedStateAwareResource
fullyInitialized, isInitializing
 
Fields inherited from class org.eclipse.xtext.resource.XtextResource
isUpdating, OPTION_ENCODING, OPTION_FORMAT, OPTION_RESOLVE_ALL, OPTION_SERIALIZATION_OPTIONS
 
Fields inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl
contents, defaultDeleteOptions, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isLoading, isModified, modificationTrackingAdapter, resourceSet, timeStamp, unloadingContents, uri, warnings
 
Fields inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
 
Constructor Summary
GrammarResource()
           
 
Method Summary
protected  void doLinking()
          Overridden to do only the clean-part of the linking but not the actual linking.
 org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource.Diagnostic> getErrors()
          Overridden to make sure the errors are up-to-date when someone wants to access them.
 org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource.Diagnostic> getWarnings()
          Overridden to make sure the warnings are up-to-date when someone wants to access them.
protected  void superDoLinking()
          Performs the actual linking.
 
Methods inherited from class org.eclipse.xtext.resource.DerivedStateAwareResource
discardDerivedState, getContents, getEObjectForURIFragmentRootSegment, getURIFragmentRootSegment, installDerivedState, setDerivedStateComputer, updateInternalState, updateInternalState
 
Methods inherited from class org.eclipse.xtext.linking.lazy.LazyLinkingResource
createAndAddDiagnostic, createAndAddDiagnostic, createDiagnostic, createDiagnosticMessage, createDiagnosticMessageContext, doLoad, getDiagnosticList, getDiagnosticMessageProvider, getEncoder, getEObject, getLinkingHelper, getLinkingService, getReferences, handleCyclicResolution, isEagerLinking, isUnresolveableProxyCacheable, removeDiagnostic, resolveLazyCrossReference, resolveLazyCrossReferences, setDiagnosticMessageProvider, setEagerLinking, setEncoder, setLinkingHelper, setLinkingService
 
Methods inherited from class org.eclipse.xtext.resource.XtextResource
addSyntaxErrors, clearErrorsAndWarnings, clearInternalState, doSave, doUnload, getCache, getConcreteSyntaxValidator, getEncoding, getFragmentProvider, getLanguageName, getLinker, getParser, getParseResult, getResourceServiceProvider, getSerializer, getUnloader, getURIFragment, isValidationDisabled, reattachModificationTracker, reparse, setCache, setEncodingFromOptions, setFragmentProvider, setInjectedParser, setLanguageName, setLinker, setParser, setParseResult, setResourceServiceProvider, setSerializer, setUnloader, setValidationDisabled, unload, update, validateConcreteSyntax
 
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl
addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, getAllContents, getAllProperContents, getAllProperContents, getDefaultURIConverter, getEObject, getEObjectByID, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getURI, getURIConverter, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isLoading, isModified, isTrackingModification, load, load, mergeMaps, newContentZipEntry, removeModificationTrackingAdapters, save, save, saveOnlyIfChangedWithFileBuffer, saveOnlyIfChangedWithMemoryBuffer, setIntrinsicIDToEObjectMap, setLoaded, setModified, setTimeStamp, setTrackingModification, setURI, toKeyString, toString, unload, unloaded, useZip
 
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
 

Constructor Detail

GrammarResource

public GrammarResource()
Method Detail

doLinking

protected void doLinking()
Overridden to do only the clean-part of the linking but not the actual linking. This is deferred until someone wants to access the content of the resource.

Overrides:
doLinking in class LazyLinkingResource

superDoLinking

protected void superDoLinking()
Performs the actual linking.


getErrors

public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource.Diagnostic> getErrors()
Overridden to make sure the errors are up-to-date when someone wants to access them.

Specified by:
getErrors in interface org.eclipse.emf.ecore.resource.Resource
Overrides:
getErrors in class org.eclipse.emf.ecore.resource.impl.ResourceImpl

getWarnings

public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource.Diagnostic> getWarnings()
Overridden to make sure the warnings are up-to-date when someone wants to access them.

Specified by:
getWarnings in interface org.eclipse.emf.ecore.resource.Resource
Overrides:
getWarnings in class org.eclipse.emf.ecore.resource.impl.ResourceImpl