public class DerivedStateAwareResource extends StorageAwareResource
LazyLinkingResource.CyclicLinkingException, LazyLinkingResource.DiagnosticMessageContextorg.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList<E extends java.lang.Object & org.eclipse.emf.ecore.EObject>, org.eclipse.emf.ecore.resource.impl.ResourceImpl.ModificationTrackingAdapterorg.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.EObservableAdapterListorg.eclipse.emf.ecore.resource.Resource.Diagnostic, org.eclipse.emf.ecore.resource.Resource.Factory, org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.ecore.resource.Resource.IOWrappedException| Modifier and Type | Field and Description |
|---|---|
protected boolean |
fullyInitialized
If
true, the contents list of the resource is complete. |
protected boolean |
isInitializing
|
UNRESOLVABLE_FRAGMENTresolving, UNRESOLVEABLE_PROXIES_KEYisUpdating, operationCanceledManager, OPTION_ENCODING, OPTION_FORMAT, OPTION_RESOLVE_ALL, OPTION_SERIALIZATION_OPTIONScontents, defaultDeleteOptions, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isLoading, isModified, modificationTrackingAdapter, resourceSet, timeStamp, unloadingContents, uri, warningseAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAGOPTION_CIPHER, OPTION_LINE_DELIMITER, OPTION_LINE_DELIMITER_UNSPECIFIED, OPTION_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS| Constructor and Description |
|---|
DerivedStateAwareResource() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearInternalState() |
void |
discardDerivedState() |
protected void |
doDiscardDerivedState() |
protected org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> |
doGetContents() |
protected void |
doUnload()
Copied from
ResourceImpl.doUnload() but doesn't call getContents() to avoid derived state
computation. |
org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> |
getContents()
As soon as an external client tries to access the content of the resource,
the
derived state will be added to the content of this resource. |
protected org.eclipse.emf.ecore.EObject |
getEObjectForURIFragmentRootSegment(java.lang.String uriFragmentRootSegment)
Not specialized because we want to obtain a fully working root instance
when the resource is queried with the root fragment.
|
protected java.util.List<org.eclipse.emf.ecore.EObject> |
getUnloadingContents() |
protected java.lang.String |
getURIFragmentRootSegment(org.eclipse.emf.ecore.EObject eObject)
Overridden to make sure that we do not initialize a resource
just to compute the root URI fragment for the parse result.
|
void |
installDerivedState(boolean preIndexingPhase) |
boolean |
isFullyInitialized()
If
true, the contents list of the resource is complete. |
boolean |
isInitializing()
|
void |
setDerivedStateComputer(IDerivedStateComputer lateInitialization) |
void |
setFullyInitialized(boolean fullyInitialized)
External means to mark a resource as fully initialized, e.g. if it was created programmatically.
|
protected void |
updateInternalState(IParseResult newParseResult)
Overridden to make sure that the cache is initialized during
loading. |
protected void |
updateInternalState(IParseResult oldParseResult,
IParseResult newParseResult) |
getEObject, getPortableURIs, getResourceDescription, getResourceStorageFacade, getUnresolvableURIFragments, isLoadedFromStorage, load, loadFromStorage, setIsLoadedFromStorage, setResourceDescriptionaddLazyProxyInformation, clearLazyProxyInformation, createAndAddDiagnostic, createAndAddDiagnostic, createDiagnostic, createDiagnosticMessage, createDiagnosticMessageContext, doLinking, doLoad, doResolveLazyCrossReference, getDiagnosticList, getDiagnosticMessageProvider, getEncoder, getEObject, getLazyProxyInformation, getLinkingHelper, getLinkingService, getReferences, handleCyclicResolution, hasLazyProxyInformation, isEagerLinking, isPotentialLazyCrossReference, isUnresolveableProxyCacheable, markUnresolvable, removeDiagnostic, removeLazyProxyInformation, resolveLazyCrossReference, resolveLazyCrossReferences, setDiagnosticMessageProvider, setEagerLinking, setEncoder, setLinkingHelper, setLinkingServiceaddSyntaxDiagnostic, addSyntaxErrors, basicGetEObject, clearErrorsAndWarnings, createReader, doSave, getCache, getConcreteSyntaxValidator, getEncoding, getFragmentProvider, getLanguageName, getLinker, getModificationStamp, getParser, getParseResult, getResourceServiceProvider, getSerializer, getUnloader, getURIFragment, isValidationDisabled, reattachModificationTracker, relink, reparse, setCache, setEncodingFromOptions, setFragmentProvider, setInjectedParser, setLanguageName, setLinker, setModificationStamp, setParser, setParseResult, setResourceServiceProvider, setSerializer, setUnloader, setValidationDisabled, unload, update, validateConcreteSyntaxaddModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, getAllContents, getAllProperContents, getAllProperContents, getDefaultURIConverter, getEObject, getEObjectByID, getErrors, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getURI, getURIConverter, getWarnings, handleLoadResponse, handleSaveResponse, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isLoading, isModified, isTrackingModification, load, mergeMaps, newContentZipEntry, removeModificationTrackingAdapters, save, save, saveOnlyIfChangedWithFileBuffer, saveOnlyIfChangedWithMemoryBuffer, setIntrinsicIDToEObjectMap, setLoaded, setModified, setTimeStamp, setTrackingModification, setURI, toKeyString, toString, unload, unloaded, useZipeAdapters, eBasicAdapters, eDeliver, eSetDelivereBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotifyprotected volatile boolean fullyInitialized
true, the contents list of the resource is complete.
Does not necessarily apply to the contents of the elements itself.protected volatile boolean isInitializing
public void setDerivedStateComputer(IDerivedStateComputer lateInitialization)
public boolean isFullyInitialized()
true, the contents list of the resource is complete.
Does not necessarily apply to the contents of the elements itself.public void setFullyInitialized(boolean fullyInitialized)
public boolean isInitializing()
public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> getContents()
As soon as an external client tries to access the content of the resource,
the derived state will be added to the content of this resource.
getContents in interface org.eclipse.emf.ecore.resource.ResourcegetContents in class org.eclipse.emf.ecore.resource.impl.ResourceImplprotected org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> doGetContents()
protected java.util.List<org.eclipse.emf.ecore.EObject> getUnloadingContents()
getUnloadingContents in class org.eclipse.emf.ecore.resource.impl.ResourceImplprotected void doUnload()
ResourceImpl.doUnload() but doesn't call getContents() to avoid derived state
computation.doUnload in class StorageAwareResourceprotected void clearInternalState()
clearInternalState in class StorageAwareResourceprotected void updateInternalState(IParseResult oldParseResult, IParseResult newParseResult)
updateInternalState in class XtextResourceoldParseResult - the previous parse result that should be detached if necessary.newParseResult - the current parse result that should be attached to the content of this resourceprotected void updateInternalState(IParseResult newParseResult)
loading.updateInternalState in class XtextResourceprotected java.lang.String getURIFragmentRootSegment(org.eclipse.emf.ecore.EObject eObject)
Overridden to make sure that we do not initialize a resource just to compute the root URI fragment for the parse result.
getURIFragmentRootSegment in class org.eclipse.emf.ecore.resource.impl.ResourceImplprotected org.eclipse.emf.ecore.EObject getEObjectForURIFragmentRootSegment(java.lang.String uriFragmentRootSegment)
Not specialized because we want to obtain a fully working root instance when the resource is queried with the root fragment.
getEObjectForURIFragmentRootSegment in class org.eclipse.emf.ecore.resource.impl.ResourceImplpublic void discardDerivedState()
public void installDerivedState(boolean preIndexingPhase)
protected void doDiscardDerivedState()