public class LazyLinkingResource extends XtextResource
Modifier and Type | Class and Description |
---|---|
static class |
LazyLinkingResource.CyclicLinkingException |
protected static class |
LazyLinkingResource.DiagnosticMessageContext |
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
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.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 java.util.LinkedHashSet<Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>> |
resolving |
static java.lang.String |
UNRESOLVEABLE_PROXIES_KEY
The cache key for a Set of uri fragments that cannot be resolved.
|
isUpdating, OPTION_ENCODING, OPTION_FORMAT, OPTION_RESOLVE_ALL, OPTION_SERIALIZATION_OPTIONS
contents, defaultDeleteOptions, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isLoading, isModified, modificationTrackingAdapter, resourceSet, timeStamp, unloadingContents, uri, warnings
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
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 and Description |
---|
LazyLinkingResource() |
Modifier and Type | Method and Description |
---|---|
int |
addLazyProxyInformation(org.eclipse.emf.ecore.EObject obj,
org.eclipse.emf.ecore.EReference ref,
INode node) |
void |
clearLazyProxyInformation() |
protected void |
createAndAddDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
protected void |
createAndAddDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple,
IllegalNodeException ex) |
protected org.eclipse.emf.ecore.resource.Resource.Diagnostic |
createDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple,
DiagnosticMessage message) |
protected DiagnosticMessage |
createDiagnosticMessage(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
protected ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext |
createDiagnosticMessageContext(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
protected void |
doLinking() |
protected void |
doLoad(java.io.InputStream inputStream,
java.util.Map<?,?> options) |
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 by
crossRef are replaced
by non-lazy proxies or resolved instances. |
protected java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> |
getDiagnosticList(DiagnosticMessage message) |
ILinkingDiagnosticMessageProvider |
getDiagnosticMessageProvider() |
LazyURIEncoder |
getEncoder() |
org.eclipse.emf.ecore.EObject |
getEObject(java.lang.String uriFragment) |
protected org.eclipse.emf.ecore.EObject |
getEObject(java.lang.String uriFragment,
Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> |
getLazyProxyInformation(int idx) |
LinkingHelper |
getLinkingHelper() |
ILinkingService |
getLinkingService() |
protected java.lang.String |
getReferences(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple,
java.util.LinkedHashSet<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.EObject |
handleCyclicResolution(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
boolean |
hasLazyProxyInformation(int idx) |
boolean |
isEagerLinking() |
protected boolean |
isPotentialLazyCrossReference(org.eclipse.emf.ecore.EStructuralFeature feature)
Return
true if the given feature may hold a proxy that has to be resolved. |
protected boolean |
isUnresolveableProxyCacheable(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
void |
markUnresolvable(org.eclipse.emf.ecore.EObject referenced)
Marks the given proxy as unresolvable.
|
protected void |
removeDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> |
removeLazyProxyInformation(int idx) |
protected void |
resolveLazyCrossReference(org.eclipse.emf.ecore.InternalEObject source,
org.eclipse.emf.ecore.EStructuralFeature crossRef)
If the given
crossRef may hold lazy linking proxies, they are attempted to be resolved. |
void |
resolveLazyCrossReferences(CancelIndicator mon)
resolves any lazy cross references in this resource, adding Issues for unresolvable elements to this resource.
|
void |
setDiagnosticMessageProvider(ILinkingDiagnosticMessageProvider diagnosticMessageProvider) |
void |
setEagerLinking(boolean eagerLinking) |
void |
setEncoder(LazyURIEncoder encoder) |
void |
setLinkingHelper(LinkingHelper linkingHelper) |
void |
setLinkingService(ILinkingService linkingService) |
addSyntaxDiagnostic, addSyntaxErrors, basicGetEObject, clearErrorsAndWarnings, clearInternalState, createReader, doSave, doUnload, getCache, getConcreteSyntaxValidator, getEncoding, getFragmentProvider, getLanguageName, getLinker, getModificationStamp, getParser, getParseResult, getResourceServiceProvider, getSerializer, getUnloader, getURIFragment, isValidationDisabled, reattachModificationTracker, reparse, setCache, setEncodingFromOptions, setFragmentProvider, setInjectedParser, setLanguageName, setLinker, setModificationStamp, setParser, setParseResult, setResourceServiceProvider, setSerializer, setUnloader, setValidationDisabled, unload, update, updateInternalState, updateInternalState, validateConcreteSyntax
addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, getAllContents, getAllProperContents, getAllProperContents, getContents, getDefaultURIConverter, getEObject, getEObjectByID, getEObjectForURIFragmentRootSegment, getErrors, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, 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, toKeyString, toString, unload, unloaded, useZip
eAdapters, eBasicAdapters, eDeliver, eSetDeliver
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
public static final java.lang.String UNRESOLVEABLE_PROXIES_KEY
protected void doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException
doLoad
in class XtextResource
java.io.IOException
protected void doLinking()
doLinking
in class XtextResource
public void resolveLazyCrossReferences(CancelIndicator mon)
mon
- a CancelIndicator
can be used to stop the resolution.protected void resolveLazyCrossReference(org.eclipse.emf.ecore.InternalEObject source, org.eclipse.emf.ecore.EStructuralFeature crossRef)
crossRef
may hold lazy linking proxies, they are attempted to be resolved.protected void doResolveLazyCrossReference(org.eclipse.emf.ecore.InternalEObject source, org.eclipse.emf.ecore.EStructuralFeature crossRef)
crossRef
are replaced
by non-lazy proxies or resolved instances.protected boolean isPotentialLazyCrossReference(org.eclipse.emf.ecore.EStructuralFeature feature)
true
if 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.public org.eclipse.emf.ecore.EObject getEObject(java.lang.String uriFragment)
getEObject
in interface org.eclipse.emf.ecore.resource.Resource
getEObject
in class XtextResource
protected org.eclipse.emf.ecore.EObject getEObject(java.lang.String uriFragment, Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) throws java.lang.AssertionError
java.lang.AssertionError
protected boolean isUnresolveableProxyCacheable(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
protected org.eclipse.emf.ecore.EObject handleCyclicResolution(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) throws java.lang.AssertionError
java.lang.AssertionError
protected java.lang.String getReferences(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, java.util.LinkedHashSet<Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode>> resolving2)
protected void createAndAddDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
protected void createAndAddDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, IllegalNodeException ex)
protected void removeDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
protected org.eclipse.emf.ecore.resource.Resource.Diagnostic createDiagnostic(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple, DiagnosticMessage message)
protected java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> getDiagnosticList(DiagnosticMessage message) throws java.lang.AssertionError
java.lang.AssertionError
protected DiagnosticMessage createDiagnosticMessage(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
protected ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext createDiagnosticMessageContext(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple)
public void setLinkingService(ILinkingService linkingService)
public ILinkingService getLinkingService()
public void setEncoder(LazyURIEncoder encoder)
public LazyURIEncoder getEncoder()
public void setEagerLinking(boolean eagerLinking)
public boolean isEagerLinking()
public ILinkingDiagnosticMessageProvider getDiagnosticMessageProvider()
public void setDiagnosticMessageProvider(ILinkingDiagnosticMessageProvider diagnosticMessageProvider)
public LinkingHelper getLinkingHelper()
public void setLinkingHelper(LinkingHelper linkingHelper)
public void markUnresolvable(org.eclipse.emf.ecore.EObject referenced)
getEObject(String)
will yield null
.protected java.util.Set<java.lang.String> getUnresolvableURIFragments()
public int addLazyProxyInformation(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EReference ref, INode node)
public boolean hasLazyProxyInformation(int idx)
public Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> getLazyProxyInformation(int idx)
public Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> removeLazyProxyInformation(int idx)
public void clearLazyProxyInformation()