private void buildCache(DatabindContext ctxt) { ResourceSet resourceSet = EMFContext.getResourceSet(ctxt); Set<EClass> types = resourceSet.getPackageRegistry().values().stream() .flatMap(model -> stream(spliteratorUnknownSize(((EPackage) model).eAllContents(), ORDERED), false)) .filter(e -> e instanceof EClass) .map(e -> (EClass) e) .collect(Collectors.toSet()); types.forEach(type -> cache.put(type, construct(ctxt, type))); }
private void buildCache(DatabindContext ctxt) { ResourceSet resourceSet = EMFContext.getResourceSet(ctxt); Set<EClass> types = resourceSet.getPackageRegistry().values().stream() .flatMap(model -> stream(spliteratorUnknownSize(((EPackage) model).eAllContents(), ORDERED), false)) .filter(e -> e instanceof EClass) .map(e -> (EClass) e) .collect(Collectors.toSet()); types.forEach(type -> cache.put(type, construct(ctxt, type))); }
for (Object next : registry.values()) { if (next instanceof EPackage) { EPackage ePackage = (EPackage) next;
for (Object next : registry.values()) { if (next instanceof EPackage) { EPackage ePackage = (EPackage) next;
for (Object next : registry.values()) { if (next instanceof EPackage) { EPackage ePackage = (EPackage) next;
for (Object next : registry.values()) { if (next instanceof EPackage) { EPackage ePackage = (EPackage) next;
/** * Lazily initialize the opposite cache for the {@link #packages} for which this opposite * end finder is responsible */ private synchronized void updateOppositeCache() { for (Object pkg : registry.values()) { // if it's not a package descriptor indicating a not yet loaded package... if (pkg instanceof EPackage) { EPackage ePackage = (EPackage) pkg; // ... and it hasn't been cached yet, cache it if (packages.add(ePackage)) { cachePackage(ePackage); } } } }
/** * {@inheritDoc} * * @see java.util.HashMap#values() */ @Override public Collection<Object> values() { Collection<Object> dynamicValues = super.values(); Collection<Object> globalValues = delegate.values(); return new AcceleoMultipleCollection<Object>(dynamicValues, globalValues); }
public Collection<Object> values() { return delegateRegistry().values(); }
public Collection<Object> values() { return delegateRegistry().values(); }
@SuppressWarnings("unchecked") public Collection<EPackage> demandedPackages() { return (Collection<EPackage>)(Collection<?>)demandRegistry.values(); }
@SuppressWarnings("unchecked") public Collection<EPackage> demandedPackages() { return (Collection<EPackage>)(Collection<?>)demandRegistry.values(); }