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 @Override
13 default IFieldInstance getInlineInstance() {
14
15 return null;
16 }
17
18
19
20
21
22
23 @Nullable
24 default Object getJsonValueKey() {
25 Object retval = getJsonValueKeyFlagInstance();
26 if (retval == null) {
27 retval = getEffectiveJsonValueKeyName();
28 }
29 return retval;
30 }
31
32
33
34
35
36
37
38 default boolean hasJsonValueKeyFlagInstance() {
39 return getJsonValueKeyFlagInstance() != null;
40 }
41
42
43
44
45
46
47
48 @Nullable
49 IFlagInstance getJsonValueKeyFlagInstance();
50
51
52
53
54
55
56
57 @Nullable
58 String getJsonValueKeyName();
59
60
61
62
63
64
65
66 @NonNull
67 default String getEffectiveJsonValueKeyName() {
68 String retval = getJsonValueKeyName();
69 if (retval == null || retval.isEmpty()) {
70 retval = getJavaTypeAdapter().getDefaultJsonValueKey();
71 }
72 return retval;
73 }
74
75
76
77
78
79
80
81
82 default Object getFieldValue(@NonNull Object item) {
83
84 return null;
85 }
86 }