1
2
3
4
5
6 package gov.nist.secauto.metaschema.core.model;
7
8 import edu.umd.cs.findbugs.annotations.NonNull;
9 import edu.umd.cs.findbugs.annotations.Nullable;
10
11 public interface IFieldDefinition extends IModelDefinition, IValuedDefinition, IField {
12
13 @Override
14 default boolean isInline() {
15
16 return false;
17 }
18
19 @Override
20 default IFieldInstance getInlineInstance() {
21
22 return null;
23 }
24
25
26
27
28
29
30 @Nullable
31 default Object getJsonValueKey() {
32 Object retval = getJsonValueKeyFlagInstance();
33 if (retval == null) {
34 retval = getEffectiveJsonValueKeyName();
35 }
36 return retval;
37 }
38
39
40
41
42
43
44
45 default boolean hasJsonValueKeyFlagInstance() {
46 return getJsonValueKeyFlagInstance() != null;
47 }
48
49
50
51
52
53
54
55 @Nullable
56 IFlagInstance getJsonValueKeyFlagInstance();
57
58
59
60
61
62
63
64 @Nullable
65 String getJsonValueKeyName();
66
67
68
69
70
71
72
73 @NonNull
74 default String getEffectiveJsonValueKeyName() {
75 String retval = getJsonValueKeyName();
76 if (retval == null || retval.isEmpty()) {
77 retval = getJavaTypeAdapter().getDefaultJsonValueKey();
78 }
79 return retval;
80 }
81
82
83
84
85
86
87
88
89 default Object getFieldValue(@NonNull Object item) {
90
91 return null;
92 }
93 }