Skip to contentMethod: includeExplicit()
1: /**
2: * Copyright (C) 2020 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: this.declaringType = declaringType;
33: this.fetchType = fetchType;
34: this.javaField = javaField;
35: this.elementType = elementType;
36: this.inferred = inferred;
37: }
38:
39: @Override
40: public ManagedType<X> getDeclaringType() {
41: return declaringType;
42: }
43:
44: @Override
45: public FetchType getFetchType() {
46: return fetchType;
47: }
48:
49: @Override
50: public Field getJavaField() {
51: return javaField;
52: }
53:
54: @Override
55: public Class<Set> getJavaType() {
56: return Set.class;
57: }
58:
59: @Override
60: public Class<Y> getElementType() {
61: return elementType;
62: }
63:
64: @Override
65: public boolean isInferred() {
66: return inferred;
67: }
68:
69: @Override
70: public boolean includeExplicit() {
71: // TODO
72: return true;
73: }
74:
75: @Override
76: public String getName() {
77: return javaField.getName();
78: }
79:
80: @Override
81: public boolean isCollection() {
82: return true;
83: }
84: }