-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.db.layer0.request;\r
-\r
-import gnu.trove.map.hash.THashMap;\r
-\r
-import java.util.Collection;\r
-import java.util.Map;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
-import org.simantics.db.common.request.ResourceRead;\r
-import org.simantics.db.exception.DatabaseException;\r
-\r
-public class UnescapedPropertyMapOfResource extends ResourceRead<Map<String, PropertyInfo>> {\r
-\r
- public UnescapedPropertyMapOfResource(Resource resource) {\r
- super(resource);\r
- }\r
-\r
- @Override\r
- public Map<String,PropertyInfo> perform(ReadGraph graph) throws DatabaseException {\r
-\r
- Collection<Resource> predicates = graph.getPredicates(resource); \r
- THashMap<String, PropertyInfo> result = new THashMap<String, PropertyInfo>(predicates.size());\r
- for(Resource predicate : predicates) {\r
- PropertyInfo info = graph.syncRequest(new PropertyInfoRequest(predicate), TransientCacheAsyncListener.<PropertyInfo>instance());\r
- if(info != null && info.isHasProperty) {\r
- String name = info.name;\r
- if (result.put(name, info) != null)\r
- System.err.println(this + ": The database resource $" + resource.getResourceId() + " contains siblings with the same name " + name + " (resource=$" + info.predicate.getResourceId() +").");\r
- } \r
- }\r
- return result;\r
- \r
- }\r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.db.layer0.request;
+
+import gnu.trove.map.hash.THashMap;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
+import org.simantics.db.common.request.ResourceRead;
+import org.simantics.db.exception.DatabaseException;
+
+public class UnescapedPropertyMapOfResource extends ResourceRead<Map<String, PropertyInfo>> {
+
+ public UnescapedPropertyMapOfResource(Resource resource) {
+ super(resource);
+ }
+
+ @Override
+ public Map<String,PropertyInfo> perform(ReadGraph graph) throws DatabaseException {
+
+ Collection<Resource> predicates = graph.getPredicates(resource);
+ THashMap<String, PropertyInfo> result = new THashMap<String, PropertyInfo>(predicates.size());
+ for(Resource predicate : predicates) {
+ PropertyInfo info = graph.syncRequest(new PropertyInfoRequest(predicate), TransientCacheAsyncListener.<PropertyInfo>instance());
+ if(info != null && info.isHasProperty) {
+ String name = info.name;
+ if (result.put(name, info) != null)
+ System.err.println(this + ": The database resource $" + resource.getResourceId() + " contains siblings with the same name " + name + " (resource=$" + info.predicate.getResourceId() +").");
+ }
+ }
+ return result;
+
+ }
+
+}