Skip to content

Method: isReadOnly()

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.model.metamodel;
16:
17: import cz.cvut.kbss.jopa.model.annotations.FetchType;
18:
19: import java.lang.reflect.Field;
20: import java.util.Set;
21:
22: public class TypesSpecificationImpl<X, Y> implements TypesSpecification<X, Y> {
23: private final ManagedType<X> declaringType;
24: private final FetchType fetchType;
25: private final Field javaField;
26: private Class<Y> elementType;
27: private boolean inferred;
28:
29: public TypesSpecificationImpl(final ManagedType<X> declaringType,
30: final FetchType fetchType, final Field javaField,
31: final Class<Y> elementType, boolean inferred) {
32:
33: this.declaringType = declaringType;
34: this.fetchType = fetchType;
35: this.javaField = javaField;
36: this.elementType = elementType;
37: this.inferred = inferred;
38: }
39:
40: @Override
41: public ManagedType<X> getDeclaringType() {
42: return declaringType;
43: }
44:
45: @Override
46: public FetchType getFetchType() {
47: return fetchType;
48: }
49:
50: @Override
51: public Field getJavaField() {
52: return javaField;
53: }
54:
55: @Override
56: public Class<Set> getJavaType() {
57: return Set.class;
58: }
59:
60: @Override
61: public Class<Y> getElementType() {
62: return elementType;
63: }
64:
65: @Override
66: public boolean isInferred() {
67: return inferred;
68: }
69:
70: @Override
71: public boolean includeExplicit() {
72: // TODO
73: return true;
74: }
75:
76: @Override
77: public boolean isReadOnly() {
78: // TODO
79: return false;
80: }
81:
82: @Override
83: public String getName() {
84: return javaField.getName();
85: }
86: }