@Override public SynchronizedXtextResourceSet get() { SynchronizedXtextResourceSet result = new SynchronizedXtextResourceSet(); result.setClasspathURIContext(classLoader); typeProviderFactory.findOrCreateTypeProvider(result); return result; }
/** * {@inheritDoc} */ @Override public List<EObject> getLinkedObjects(final EObject context, final EReference ref, final INode node) { ResourceSet resourceSet = context.eResource().getResourceSet(); if (ref == FormatPackage.Literals.FORMAT_CONFIGURATION__TARGET_GRAMMAR) { List<EObject> usedGrammars = getUsedGrammar(resourceSet, NodeModelUtils.getTokenText(node)); if (!usedGrammars.isEmpty()) { return usedGrammars; } else { return super.getLinkedObjects(context, ref, node); } } else if (ref == FormatPackage.Literals.FORMAT_CONFIGURATION__EXTENDED_FORMAT_CONFIGURATION) { List<EObject> extendedFormatConfigurations = getExtendedFormatConfiguration(resourceSet, node); if (!extendedFormatConfigurations.isEmpty()) { return extendedFormatConfigurations; } else { return super.getLinkedObjects(context, ref, node); } } else if ((ref == FormatPackage.Literals.INT_VALUE__REFERENCE || ref == FormatPackage.Literals.STRING_VALUE__REFERENCE) && !(resourceSet instanceof SynchronizedXtextResourceSet)) { List<EObject> res = super.getLinkedObjects(context, ref, node); if (res == null || res.isEmpty()) { return getConstant(resourceSet, node); } else { return res; } } else if (ref == FormatPackage.Literals.RULE__OVERRIDE) { return getExtendedFormatConfiguration(resourceSet, node); } return super.getLinkedObjects(context, ref, node); }
public ModelRepositoryImpl() { XtextResourceSet xtextResourceSet = new SynchronizedXtextResourceSet(); xtextResourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); this.resourceSet = xtextResourceSet; // don't use XMI as a default Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().remove("*"); }
/** * De-configure the hard coded built in scheme from the runtime bundle. */ public Class<? extends XtextResourceSet> bindXtextResourceSet() { return SynchronizedXtextResourceSet.class; }
public Class<? extends Provider<SynchronizedXtextResourceSet>> provideSynchronizedResourceSet() { return SynchronizedXtextResourceSetProvider.class; }
public Class<? extends XtextResourceSet> bindXtextResourceSet() { return SynchronizedXtextResourceSet.class; }
@Override protected XtextResourceSet createEmptyResourceSet() { return new SynchronizedXtextResourceSet(); }