Skip to content

Package: FieldSpecification

FieldSpecification

Coverage

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.NonJPA;
18: import cz.cvut.kbss.jopa.model.annotations.FetchType;
19:
20: public interface FieldSpecification<X, E> {
21:
22: /**
23: * Return the managed type representing the type in which the attribute was
24: * declared.
25: *
26: * @return declaring type
27: */
28: ManagedType<X> getDeclaringType();
29:
30: /**
31: * Return the Java type of the represented attribute.
32: *
33: * @return Java type
34: */
35: Class<E> getJavaType();
36:
37: /**
38: * Return the java.lang.reflect.Member for the represented attribute.
39: *
40: * @return corresponding java.lang.reflect.Member
41: */
42: @NonJPA
43: java.lang.reflect.Field getJavaField();
44:
45: /**
46: * Whether the association is lazily loaded or must be eagerly fetched.
47: *
48: * @return Fetch type of the field specification
49: */
50: @NonJPA
51: FetchType getFetchType();
52:
53: /**
54: * Whether this field can contain inferred data.
55: *
56: * @return Whether field is inferred
57: * @see #includeExplicit()
58: */
59: boolean isInferred();
60:
61: /**
62: * If this field is inferred, can it contain explicit data as well?
63: *
64: * @return Whether inferred field can contain explicit knowledge
65: * @see #isInferred()
66: */
67: boolean includeExplicit();
68:
69: /**
70: * Whether values of this field cannot be modified.
71: *
72: * @return Read only status of this field
73: */
74: boolean isReadOnly();
75:
76: /**
77: * Return the name of the attribute.
78: *
79: * @return name
80: */
81: String getName();
82: }