Skip to content

Method: getSimpleList()

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