Class 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
    • 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
    • Constructor Detail

      • LazyLinkingResource

        public LazyLinkingResource()
    • Method Detail

      • doLoad

        protected void doLoad​(java.io.InputStream inputStream,
                              java.util.Map<?,​?> options)
                       throws java.io.IOException
        Overrides:
        doLoad in class XtextResource
        Throws:
        java.io.IOException
      • 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 - a CancelIndicator can be used to stop the resolution.
      • 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 by crossRef are replaced by non-lazy proxies or resolved instances.
        Since:
        2.4
      • isPotentialLazyCrossReference

        protected boolean isPotentialLazyCrossReference​(org.eclipse.emf.ecore.EStructuralFeature feature)
        Return 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.
        Since:
        2.4
      • getEObject

        public org.eclipse.emf.ecore.EObject getEObject​(java.lang.String uriFragment)
        Specified by:
        getEObject in interface org.eclipse.emf.ecore.resource.Resource
        Overrides:
        getEObject in class XtextResource
      • 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)
      • setLinkingService

        public void setLinkingService​(ILinkingService linkingService)
      • setEagerLinking

        public void setEagerLinking​(boolean eagerLinking)
      • isEagerLinking

        public boolean isEagerLinking()
      • 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 of getEObject(String) will yield null.
        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 a Triple of 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