Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Xtext Project Plan/Features/FragmentProvider

< Xtext Project Plan
Revision as of 02:29, 28 July 2008 by Sven.efftinge.typefox.io (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Each EObject contained in a Resource can be identified by a so called 'fragment'. A fragment is a part of an EMF URI and needs to be unique per resource. The generic XMI resource shipped with EMF provides a generic path-like computation of fragments. It is also common and possible to use UUIDs.

However with a textual concrete syntax we want to be able to compute fragments out of the given information. We don't want to force people to use UUIDs or relative generic pathes, in order to do cross-referencing. Therefore one can contribute a so called IFragmentProvider per language.

interface IFragmentProvider extends ILanguageService {
    String getFragment(EObject obj);
}


There is a default provider registered for the xtext builtin language, wich can be easily overwritten. The default implementation just returns the "name" value if it exists and is unique, otherwise it delegates to the path-like fragments computation known from XMI resources.

Back to the top