1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.opencastproject.annotation.impl;
23
24 import org.opencastproject.annotation.api.Annotation;
25 import org.opencastproject.annotation.api.AnnotationList;
26
27 import java.util.ArrayList;
28 import java.util.List;
29
30 import javax.xml.bind.annotation.XmlAccessType;
31 import javax.xml.bind.annotation.XmlAccessorType;
32 import javax.xml.bind.annotation.XmlAttribute;
33 import javax.xml.bind.annotation.XmlElement;
34 import javax.xml.bind.annotation.XmlRootElement;
35 import javax.xml.bind.annotation.XmlType;
36
37
38
39
40 @XmlType(name = "annotations", namespace = "http://annotation.opencastproject.org")
41 @XmlRootElement(name = "annotations", namespace = "http://annotation.opencastproject.org")
42 @XmlAccessorType(XmlAccessType.FIELD)
43 public class AnnotationListImpl implements AnnotationList {
44
45 @XmlAttribute(name = "total")
46 protected int total;
47
48 @XmlAttribute(name = "offset")
49 protected int offset;
50
51 @XmlAttribute(name = "limit")
52 protected int limit;
53
54 @XmlElement(name = "annotation")
55 protected List<AnnotationImpl> annotations;
56
57 public void add(Annotation annotation) {
58 annotations.add((AnnotationImpl) annotation);
59 }
60
61
62
63
64 public AnnotationListImpl() {
65 this.annotations = new ArrayList<AnnotationImpl>();
66 }
67
68 public void setTotal(int total) {
69 this.total = total;
70 }
71
72 public void setLimit(int limit) {
73 this.limit = limit;
74 }
75
76 public void setOffset(int offset) {
77 this.offset = offset;
78 }
79
80 @Override
81 public int getTotal() {
82 return total;
83 }
84
85 @Override
86 public int getLimit() {
87 return limit;
88 }
89
90 @Override
91 public int getOffset() {
92 return offset;
93 }
94
95 @Override
96 public List<Annotation> getAnnotations() {
97 return new ArrayList<Annotation>(annotations);
98 }
99 }