diff src/main/java/de/mpiwg/itgroup/annotations/Annotation.java @ 48:0e00bf8e27fb

targets and resources of Annotation object are objects now.
author casties
date Wed, 26 Sep 2012 18:10:47 +0200
parents 03e0f7574224
children 64aa756c60cc
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/annotations/Annotation.java	Wed Sep 26 17:30:52 2012 +0200
+++ b/src/main/java/de/mpiwg/itgroup/annotations/Annotation.java	Wed Sep 26 18:10:47 2012 +0200
@@ -28,9 +28,9 @@
     protected String bodyUri;
     
     /**
-     * The base URI of the annotation target.
+     * The annotation target.
      */
-    protected String targetBaseUri;
+    protected Target target;
     
     /**
      * The fragment part of the annotation target.
@@ -52,10 +52,10 @@
     
     
     /**
-     * The uri of the resource that is annotated e.g. a book. 
+     * The Resource that is annotated e.g. a book. 
      * The target is part of this resource e.g. a page of a book.
      */
-    protected String resourceUri;
+    protected Resource resource;
     
     /**
      * The creator of this annotation.
@@ -188,17 +188,25 @@
     }
 
     /**
+     * @return the target
+     */
+    public Target getTarget() {
+        return target;
+    }
+
+    /**
+     * @param target the target to set
+     */
+    public void setTarget(Target target) {
+        this.target = target;
+    }
+
+    /**
      * @return the targetBaseUri
      */
     public String getTargetBaseUri() {
-        return targetBaseUri;
-    }
-
-    /**
-     * @param targetBaseUri the targetBaseUri to set
-     */
-    public void setTargetBaseUri(String targetBaseUri) {
-        this.targetBaseUri = targetBaseUri;
+        if (target == null) return null;
+        return target.getUri();
     }
 
     /**
@@ -230,17 +238,25 @@
     }
 
     /**
+     * @return the resource
+     */
+    public Resource getResource() {
+        return resource;
+    }
+
+    /**
+     * @param resource the resource to set
+     */
+    public void setResource(Resource resource) {
+        this.resource = resource;
+    }
+
+    /**
      * @return the resourceUri
      */
     public String getResourceUri() {
-        return resourceUri;
-    }
-
-    /**
-     * @param resourceUri the resourceUri to set
-     */
-    public void setResourceUri(String resourceUri) {
-        this.resourceUri = resourceUri;
+        if (resource == null) return null;
+        return resource.getUri();
     }
 
     /**