]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/EntityStringModifierFactory.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / impl / EntityStringModifierFactory.java
index 03d6ac9a447d923e53c6d9c4bf27c693d35cecd1..cbc2c061adc048dc15045cf035d4fd59fe1eb084 100644 (file)
@@ -1,57 +1,57 @@
-/*******************************************************************************\r
- * Copyright (c) 2013 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
- *     Semantum Oy - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.db.layer0.adapter.impl;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.adapter.StringModifier;\r
-import org.simantics.db.layer0.adapter.StringModifierFactory;\r
-import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.layer0.Layer0;\r
-\r
-/**\r
- * Makes sure that two things apply for L0.HasName of any entity:\r
- * <ol>\r
- * <li>An entity must not have the same name as any of its\r
- * L0.PartOf/L0.ConsistsOf related siblings</li>\r
- * <li>An entity's name must not begin with one or more dots ('.'). Due to\r
- * limitations imposed by the Variable specification no resources in the\r
- * simantics database should be named beginning with one or more dots. '.' is\r
- * variable browsing syntax for "parent" (see\r
- * {@link Variable#browse(ReadGraph, String)}). This is comparable to file\r
- * systems and the use of '.' and '..' therein.</li>\r
- * </ol>\r
- * \r
- * @author Tuukka Lehtonen\r
- */\r
-public final class EntityStringModifierFactory implements StringModifierFactory {\r
-\r
-    private Resource subject;\r
-\r
-    public EntityStringModifierFactory(Resource subject) throws DatabaseException {\r
-        this.subject = subject;\r
-    }\r
-\r
-    @Override\r
-    public StringModifier createModifier(ReadGraph graph, Resource relation, Resource property) throws DatabaseException {\r
-        Layer0 L0 = Layer0.getInstance(graph);\r
-\r
-        // Names require special care in validation.\r
-        if (L0.HasName.equals(relation)) {\r
-            return new EntityNameModifier(graph, subject, property);\r
-        }\r
-\r
-        return null;\r
-    }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ *     Semantum Oy - initial API and implementation
+ *******************************************************************************/
+package org.simantics.db.layer0.adapter.impl;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.adapter.StringModifier;
+import org.simantics.db.layer0.adapter.StringModifierFactory;
+import org.simantics.db.layer0.variable.Variable;
+import org.simantics.layer0.Layer0;
+
+/**
+ * Makes sure that two things apply for L0.HasName of any entity:
+ * <ol>
+ * <li>An entity must not have the same name as any of its
+ * L0.PartOf/L0.ConsistsOf related siblings</li>
+ * <li>An entity's name must not begin with one or more dots ('.'). Due to
+ * limitations imposed by the Variable specification no resources in the
+ * simantics database should be named beginning with one or more dots. '.' is
+ * variable browsing syntax for "parent" (see
+ * {@link Variable#browse(ReadGraph, String)}). This is comparable to file
+ * systems and the use of '.' and '..' therein.</li>
+ * </ol>
+ * 
+ * @author Tuukka Lehtonen
+ */
+public final class EntityStringModifierFactory implements StringModifierFactory {
+
+    private Resource subject;
+
+    public EntityStringModifierFactory(Resource subject) throws DatabaseException {
+        this.subject = subject;
+    }
+
+    @Override
+    public StringModifier createModifier(ReadGraph graph, Resource relation, Resource property) throws DatabaseException {
+        Layer0 L0 = Layer0.getInstance(graph);
+
+        // Names require special care in validation.
+        if (L0.HasName.equals(relation)) {
+            return new EntityNameModifier(graph, subject, property);
+        }
+
+        return null;
+    }
+
+}