Interface IFragmentProvider

  • All Known Implementing Classes:
    DefaultFragmentProvider, XtextFragmentProvider

    public interface IFragmentProvider
    Used to compute fragments (i.e. resource local IDs) for EObjects and locate EObjects by fragment. Typically used within a Resource.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  IFragmentProvider.Fallback
      Delegate the resolution of EObject or the computation of fragments to the default implementation by invoking the respective methods on the given instance of this fall-back delegate.
    • Method Detail

      • getFragment

        java.lang.String getFragment​(org.eclipse.emf.ecore.EObject obj,
                                     IFragmentProvider.Fallback fallback)
        Computes the URI fragment (local ID) of the given object.
        Parameters:
        obj - the EObject to compute the fragment for.
        fallback - if the default behavior should be used, delegate the computation of the fragment to the default implementation of Resource.getURIFragment(EObject).
        Returns:
        the fragment, which can be an arbitrary string but must be unique within a resource. May not return null.
      • getEObject

        org.eclipse.emf.ecore.EObject getEObject​(org.eclipse.emf.ecore.resource.Resource resource,
                                                 java.lang.String fragment,
                                                 IFragmentProvider.Fallback fallback)
        Locates an EObject in a resource by its fragment.
        Parameters:
        resource - the resource serves as context instance.
        fragment - the fragment of the object.
        fallback - if the fragment was not created by this provider, delegate the resolution to the default implementation of Resource.getEObject(String).
        Returns:
        the resolved object or null if the fragment could not be resolved to an object.