コード例 #1
0
 public static Resource getResource(EObject object) {
   InsertionAdapter adapter = AdapterUtil.adapt(object, InsertionAdapter.class);
   if (adapter != null) {
     return adapter.getResource();
   }
   if (object != null) return object.eResource();
   return null;
 }
コード例 #2
0
 public Resource getResource() {
   if (resource == null) {
     Resource res = object.eResource();
     if (res != null) return res;
     InsertionAdapter insertionAdapter = AdapterUtil.adapt(object, InsertionAdapter.class);
     if (insertionAdapter != null) return insertionAdapter.getResource();
   }
   return resource;
 }