Package org.eclipse.xtext.linking.lazy
Class LazyLinkingResource
- java.lang.Object
-
- org.eclipse.emf.common.notify.impl.BasicNotifierImpl
-
- org.eclipse.emf.common.notify.impl.NotifierImpl
-
- org.eclipse.emf.ecore.resource.impl.ResourceImpl
-
- org.eclipse.xtext.resource.XtextResource
-
- org.eclipse.xtext.linking.lazy.LazyLinkingResource
-
- All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier,org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.resource.Resource.Internal
- Direct Known Subclasses:
StorageAwareResource
public class LazyLinkingResource extends XtextResource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLazyLinkingResource.CyclicLinkingExceptionprotected static classLazyLinkingResource.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>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList
-
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource
org.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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCYCLIC_LINKING_DECTECTION_COUNTER_LIMITDetermines the limit that is used to switch from a counter to a set to detect cyclic linking.protected intcyclicLinkingDectectionCounterLimitprotected java.util.LinkedHashSet<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>>resolvingstatic java.lang.StringUNRESOLVEABLE_PROXIES_KEYThe cache key for a Set of uri fragments that cannot be resolved.-
Fields inherited from class org.eclipse.xtext.resource.XtextResource
isUpdating, operationCanceledManager, 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
-
Fields inherited from interface org.eclipse.emf.ecore.resource.Resource
OPTION_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 Summary
Constructors Constructor Description LazyLinkingResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddLazyProxyInformation(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EReference ref, INode node)voidclearLazyProxyInformation()protected voidcreateAndAddDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)protected voidcreateAndAddDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, IllegalNodeException ex)protected org.eclipse.emf.ecore.resource.Resource.DiagnosticcreateDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, DiagnosticMessage message)protected DiagnosticMessagecreateDiagnosticMessage(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)protected ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContextcreateDiagnosticMessageContext(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)protected voiddoLinking()protected voiddoLoad(java.io.InputStream inputStream, java.util.Map<?,?> options)protected voiddoResolveLazyCrossReference(org.eclipse.emf.ecore.InternalEObject source, org.eclipse.emf.ecore.EStructuralFeature crossRef)Ensures that all the lazy proxy values that are referenced bycrossRefare replaced by non-lazy proxies or resolved instances.protected java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic>getDiagnosticList(DiagnosticMessage message)ILinkingDiagnosticMessageProvidergetDiagnosticMessageProvider()LazyURIEncodergetEncoder()org.eclipse.emf.ecore.EObjectgetEObject(java.lang.String uriFragment)protected org.eclipse.emf.ecore.EObjectgetEObject(java.lang.String uriFragment, org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)protected java.util.List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>>getLazyProxyInformation()Returns the list of installed lazy linking proxies encoded as aTripleof the owning object, the reference and the node that holds the raw text for the link.org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>getLazyProxyInformation(int idx)LinkingHelpergetLinkingHelper()ILinkingServicegetLinkingService()protected java.lang.StringgetReferences(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, java.util.LinkedHashSet<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>> resolving2)protected java.util.Set<java.lang.String>getUnresolvableURIFragments()protected org.eclipse.emf.ecore.EObjecthandleCyclicResolution(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)booleanhasLazyProxyInformation(int idx)booleanisEagerLinking()protected booleanisPotentialLazyCrossReference(org.eclipse.emf.ecore.EStructuralFeature feature)Returntrueif the given feature may hold a proxy that has to be resolved.protected booleanisUnresolveableProxyCacheable(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)voidmarkUnresolvable(org.eclipse.emf.ecore.EObject referenced)Marks the given proxy as unresolvable.protected voidremoveDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>removeLazyProxyInformation(int idx)protected voidresolveLazyCrossReference(org.eclipse.emf.ecore.InternalEObject source, org.eclipse.emf.ecore.EStructuralFeature crossRef)If the givencrossRefmay hold lazy linking proxies, they are attempted to be resolved.voidresolveLazyCrossReferences(org.eclipse.xtext.util.CancelIndicator mon)resolves any lazy cross references in this resource, adding Issues for unresolvable elements to this resource.voidsetDiagnosticMessageProvider(ILinkingDiagnosticMessageProvider diagnosticMessageProvider)voidsetEagerLinking(boolean eagerLinking)voidsetEncoder(LazyURIEncoder encoder)voidsetLinkingHelper(LinkingHelper linkingHelper)voidsetLinkingService(ILinkingService linkingService)-
Methods inherited from class org.eclipse.xtext.resource.XtextResource
addSyntaxDiagnostic, addSyntaxErrors, basicGetEObject, clearCache, clearErrorsAndWarnings, clearInternalState, createReader, doSave, doUnload, getCache, getConcreteSyntaxValidator, getEncoding, getEntryPoint, getFragmentProvider, getLanguageName, getLinker, getModificationStamp, getParser, getParseResult, getResourceServiceProvider, getSerializer, getUnloader, getURIFragment, isValidationDisabled, reattachModificationTracker, relink, reparse, setCache, setEncodingFromOptions, setEntryPoint, setFragmentProvider, setInjectedParser, setLanguageName, setLinker, setModificationStamp, setParser, setParseResult, setResourceServiceProvider, setSerializer, setUnloader, setValidationDisabled, unload, update, updateInternalState, updateInternalState, validateConcreteSyntax
-
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl
addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, getAllContents, getAllProperContents, getAllProperContents, getContents, getDefaultURIConverter, getEObject, getEObjectByID, getEObjectForURIFragmentRootSegment, getErrors, getIDForEObject, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getUnloadingContents, getURI, getURIConverter, getURIFragmentRootSegment, getWarnings, handleLoadResponse, handleSaveResponse, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isLoading, isModified, isTrackingModification, load, load, mergeMaps, newContentZipEntry, removeModificationTrackingAdapters, save, save, saveOnlyIfChangedWithFileBuffer, saveOnlyIfChangedWithMemoryBuffer, setIntrinsicIDToEObjectMap, setLoaded, setModified, setTimeStamp, setTrackingModification, setURI, supportIDRelativeURIFragmentPaths, 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
-
-
-
-
Field Detail
-
UNRESOLVEABLE_PROXIES_KEY
public static final java.lang.String UNRESOLVEABLE_PROXIES_KEY
The cache key for a Set of uri fragments that cannot be resolved.- Since:
- 2.4
- See Also:
- Constant Field Values
-
CYCLIC_LINKING_DECTECTION_COUNTER_LIMIT
public static final java.lang.String CYCLIC_LINKING_DECTECTION_COUNTER_LIMIT
Determines the limit that is used to switch from a counter to a set to detect cyclic linking.- Since:
- 2.16
- See Also:
- Constant Field Values
-
cyclicLinkingDectectionCounterLimit
@Named("CYCLIC_LINKING_DECTECTION_COUNTER_LIMIT") @Inject(optional=true) protected int cyclicLinkingDectectionCounterLimit
-
resolving
protected java.util.LinkedHashSet<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>> resolving
- Since:
- 2.4
-
-
Method Detail
-
doLoad
protected void doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException- Overrides:
doLoadin classXtextResource- Throws:
java.io.IOException
-
doLinking
protected void doLinking()
- Overrides:
doLinkingin classXtextResource
-
resolveLazyCrossReferences
public void resolveLazyCrossReferences(org.eclipse.xtext.util.CancelIndicator mon)
resolves any lazy cross references in this resource, adding Issues for unresolvable elements to this resource. This resource might still contain resolvable proxies after this method has been called.- Parameters:
mon- aCancelIndicatorcan be used to stop the resolution.
-
resolveLazyCrossReference
protected void resolveLazyCrossReference(org.eclipse.emf.ecore.InternalEObject source, org.eclipse.emf.ecore.EStructuralFeature crossRef)If the givencrossRefmay hold lazy linking proxies, they are attempted to be resolved.
-
doResolveLazyCrossReference
protected void doResolveLazyCrossReference(org.eclipse.emf.ecore.InternalEObject source, org.eclipse.emf.ecore.EStructuralFeature crossRef)Ensures that all the lazy proxy values that are referenced bycrossRefare replaced by non-lazy proxies or resolved instances.- Since:
- 2.4
-
isPotentialLazyCrossReference
protected boolean isPotentialLazyCrossReference(org.eclipse.emf.ecore.EStructuralFeature feature)
Returntrueif the given feature may hold a proxy that has to be resolved. This is supposed to be an internal hook which allows to resolve proxies even in cases where EMF prohibits proxies, e.g. in case of opposite references.- Since:
- 2.4
-
getEObject
public org.eclipse.emf.ecore.EObject getEObject(java.lang.String uriFragment)
- Specified by:
getEObjectin interfaceorg.eclipse.emf.ecore.resource.Resource- Overrides:
getEObjectin classXtextResource
-
getEObject
protected org.eclipse.emf.ecore.EObject getEObject(java.lang.String uriFragment, org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) throws java.lang.AssertionError- Throws:
java.lang.AssertionError- Since:
- 2.4
-
isUnresolveableProxyCacheable
protected boolean isUnresolveableProxyCacheable(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
- Since:
- 2.1
-
handleCyclicResolution
protected org.eclipse.emf.ecore.EObject handleCyclicResolution(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) throws java.lang.AssertionError
- Throws:
java.lang.AssertionError
-
getReferences
protected java.lang.String getReferences(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, java.util.LinkedHashSet<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>> resolving2)
-
createAndAddDiagnostic
protected void createAndAddDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
-
createAndAddDiagnostic
protected void createAndAddDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, IllegalNodeException ex)
- Since:
- 2.3
-
removeDiagnostic
protected void removeDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
-
createDiagnostic
protected org.eclipse.emf.ecore.resource.Resource.Diagnostic createDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, DiagnosticMessage message)
-
getDiagnosticList
protected java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> getDiagnosticList(DiagnosticMessage message) throws java.lang.AssertionError
- Throws:
java.lang.AssertionError
-
createDiagnosticMessage
protected DiagnosticMessage createDiagnosticMessage(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
-
createDiagnosticMessageContext
protected ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext createDiagnosticMessageContext(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
-
setLinkingService
public void setLinkingService(ILinkingService linkingService)
-
getLinkingService
public ILinkingService getLinkingService()
-
setEncoder
public void setEncoder(LazyURIEncoder encoder)
-
getEncoder
public LazyURIEncoder getEncoder()
-
setEagerLinking
public void setEagerLinking(boolean eagerLinking)
-
isEagerLinking
public boolean isEagerLinking()
-
getDiagnosticMessageProvider
public ILinkingDiagnosticMessageProvider getDiagnosticMessageProvider()
-
setDiagnosticMessageProvider
public void setDiagnosticMessageProvider(ILinkingDiagnosticMessageProvider diagnosticMessageProvider)
-
getLinkingHelper
public LinkingHelper getLinkingHelper()
-
setLinkingHelper
public void setLinkingHelper(LinkingHelper linkingHelper)
-
markUnresolvable
public void markUnresolvable(org.eclipse.emf.ecore.EObject referenced)
Marks the given proxy as unresolvable. Further attempts to resolve it by means ofgetEObject(String)will yieldnull.- Since:
- 2.4
-
getUnresolvableURIFragments
protected java.util.Set<java.lang.String> getUnresolvableURIFragments()
- Since:
- 2.4
-
getLazyProxyInformation
protected java.util.List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>> getLazyProxyInformation()
Returns the list of installed lazy linking proxies encoded as aTripleof the owning object, the reference and the node that holds the raw text for the link.- Since:
- 2.23
-
addLazyProxyInformation
public int addLazyProxyInformation(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EReference ref, INode node)- Since:
- 2.7
-
hasLazyProxyInformation
public boolean hasLazyProxyInformation(int idx)
- Since:
- 2.7
-
getLazyProxyInformation
public org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> getLazyProxyInformation(int idx)
- Since:
- 2.7
-
removeLazyProxyInformation
public org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> removeLazyProxyInformation(int idx)
- Since:
- 2.7
-
clearLazyProxyInformation
public void clearLazyProxyInformation()
- Since:
- 2.7
-
-