You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2012/07/27 12:18:31 UTC

svn commit: r1366328 - /incubator/stanbol/trunk/commons/ldpath/clerezza/src/main/java/org/apache/stanbol/commons/ldpath/clerezza/ClerezzaBackend.java

Author: rwesten
Date: Fri Jul 27 10:18:31 2012
New Revision: 1366328

URL: http://svn.apache.org/viewvc?rev=1366328&view=rev
Log:
Extended the CllerezzaBackend with protected getter and setter for the wrapped Graph. This is intended to allow components that get its Clerezza graph only during activation to extend this LDPath Backend implementations. This will be used by the ClerezzaStore implementation (part of STANBOL-704) to provide also a LDPath Backend.

Modified:
    incubator/stanbol/trunk/commons/ldpath/clerezza/src/main/java/org/apache/stanbol/commons/ldpath/clerezza/ClerezzaBackend.java

Modified: incubator/stanbol/trunk/commons/ldpath/clerezza/src/main/java/org/apache/stanbol/commons/ldpath/clerezza/ClerezzaBackend.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/ldpath/clerezza/src/main/java/org/apache/stanbol/commons/ldpath/clerezza/ClerezzaBackend.java?rev=1366328&r1=1366327&r2=1366328&view=diff
==============================================================================
--- incubator/stanbol/trunk/commons/ldpath/clerezza/src/main/java/org/apache/stanbol/commons/ldpath/clerezza/ClerezzaBackend.java (original)
+++ incubator/stanbol/trunk/commons/ldpath/clerezza/src/main/java/org/apache/stanbol/commons/ldpath/clerezza/ClerezzaBackend.java Fri Jul 27 10:18:31 2012
@@ -145,10 +145,32 @@ public class ClerezzaBackend extends Abs
     
     private static LiteralFactory lf = LiteralFactory.getInstance();
 
+    /**
+     * Allows sub-classes to create a instance and setting the {@link #graph}
+     * later on by using {@link #setGraph(TripleCollection)}.
+     */
+    protected ClerezzaBackend() {
+    }
+    /**
+     * Constructs a Clerezza {@link RDFBackend} by using the parsed {@link TripleCollection}
+     * @param graph the {@link TripleCollection}
+     * @throws IllegalArgumentException if <code>null</code> is parsed as graph.
+     */
     public ClerezzaBackend(TripleCollection graph) {
+        if(graph == null){
+            throw new IllegalArgumentException("The parsed Graph MUST NOT be NULL!");
+        }
         this.graph = graph;
     }
+    
+    protected final TripleCollection getGraph(){
+        return this.graph;
+    }
 
+    protected final void setGraph(TripleCollection graph){
+        this.graph = graph;
+    }
+    
     @Override
     public Resource createLiteral(String content) {
         return createLiteral(content,null,null);