コード例 #1
0
 protected ISelectable getAllDescriptions(final Resource resource) {
   return cache.get(
       "internalGetAllDescriptions",
       resource,
       new Provider<ISelectable>() {
         public ISelectable get() {
           return internalGetAllDescriptions(resource);
         }
       });
 }
コード例 #2
0
 protected List<ImportNormalizer> getImportedNamespaceResolvers(
     final EObject context, final boolean ignoreCase) {
   return cache.get(
       Tuples.create(context, ignoreCase, "imports"),
       context.eResource(),
       new Provider<List<ImportNormalizer>>() {
         public List<ImportNormalizer> get() {
           return internalGetImportedNamespaceResolvers(context, ignoreCase);
         }
       });
 }
コード例 #3
0
 @Override
 public IResourceDescription getResourceDescription(final Resource resource) {
   return cache.get(
       CACHE_KEY,
       resource,
       new Provider<IResourceDescription>() {
         @Override
         public IResourceDescription get() {
           return internalGetResourceDescription(resource, strategy);
         }
       });
 }
コード例 #4
0
 public String getHash(final JvmDeclaredType type) {
   if (type.eResource() instanceof TypeResource) {
     IMirror mirror = ((TypeResource) type.eResource()).getMirror();
     if (mirror instanceof IMirrorExtension && ((IMirrorExtension) mirror).isSealed())
       return type.getIdentifier();
   }
   return cache.get(
       Tuples.create(HASH_CACHE_KEY, type),
       type.eResource(),
       new Provider<String>() {
         public String get() {
           return signatureBuilderProvider.get().appendSignature(type).hash();
         }
       });
 }
コード例 #5
0
 protected LinkedHashSet<URI> getImportedUris(final Resource resource) {
   return cache.get(
       ImportUriGlobalScopeProvider.class.getName(),
       resource,
       new Provider<LinkedHashSet<URI>>() {
         public LinkedHashSet<URI> get() {
           TreeIterator<EObject> iterator = resource.getAllContents();
           final LinkedHashSet<URI> uniqueImportURIs = new LinkedHashSet<URI>(10);
           while (iterator.hasNext()) {
             EObject object = iterator.next();
             String uri = importResolver.apply(object);
             if (uri != null) {
               URI importUri = URI.createURI(uri);
               uniqueImportURIs.add(importUri);
             }
           }
           Iterator<URI> uriIter = uniqueImportURIs.iterator();
           while (uriIter.hasNext()) {
             if (!EcoreUtil2.isValidUri(resource, uriIter.next())) uriIter.remove();
           }
           return uniqueImportURIs;
         }
       });
 }