Skip to contentMethod: getSimpleList()
1: /**
2: * Copyright (C) 2016 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.test;
16:
17: import cz.cvut.kbss.jopa.model.annotations.*;
18:
19: import java.lang.reflect.Field;
20: import java.net.URI;
21: import java.util.List;
22:
23: @OWLClass(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/entities#OWLClassC")
24: public class OWLClassC {
25:
26: @Id
27: private URI uri;
28:
29: @Sequence
30: @OWLObjectProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#C-hasReferencedSequence", fetch = FetchType.EAGER)
31: private List<OWLClassA> referencedList;
32:
33: @Sequence(type = SequenceType.simple, ObjectPropertyHasNextIRI = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#C-hasSimpleNext")
34: @OWLObjectProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#C-hasSimpleSequence")
35: private List<OWLClassA> simpleList;
36:
37: public OWLClassC() {
38: }
39:
40: public OWLClassC(URI uri) {
41: this.uri = uri;
42: }
43:
44: public void setUri(URI uri) {
45: this.uri = uri;
46: }
47:
48: public URI getUri() {
49: return uri;
50: }
51:
52: public void setReferencedList(List<OWLClassA> list) {
53: this.referencedList = list;
54: }
55:
56: public List<OWLClassA> getReferencedList() {
57: return referencedList;
58: }
59:
60: public void setSimpleList(List<OWLClassA> simpleList) {
61: this.simpleList = simpleList;
62: }
63:
64: public List<OWLClassA> getSimpleList() {
65: return simpleList;
66: }
67:
68: @Override
69: public String toString() {
70: String out = "OWLClassC: uri = " + uri;
71: if (referencedList != null) {
72: out += ", referencedList = {" + referencedList.toString() + "}";
73: }
74: if (simpleList != null) {
75: out += ", simpleList = {" + simpleList.toString() + "}";
76: }
77: return out;
78: }
79:
80: public static Field getReferencedListField() throws NoSuchFieldException {
81: return OWLClassC.class.getDeclaredField("referencedList");
82: }
83:
84: public static Field getSimpleListField() throws NoSuchFieldException {
85: return OWLClassC.class.getDeclaredField("simpleList");
86: }
87: }