1
2
3
4
5
6 package gov.nist.secauto.metaschema.databind.model.info;
7
8 import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter;
9 import gov.nist.secauto.metaschema.core.model.IBoundObject;
10 import gov.nist.secauto.metaschema.databind.io.BindingException;
11 import gov.nist.secauto.metaschema.databind.model.IValuedMutable;
12
13 import edu.umd.cs.findbugs.annotations.NonNull;
14
15 public interface IFeatureScalarItemValueHandler
16 extends IItemValueHandler<Object>, IValuedMutable {
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 default void setValue(@NonNull Object parent, @NonNull String text) {
33 Object item = getValueFromString(text);
34 setValue(parent, item);
35 }
36
37
38
39
40
41
42
43
44
45
46
47 default Object getValueFromString(@NonNull String text) {
48 return getJavaTypeAdapter().parse(text);
49 }
50
51
52
53
54
55
56 @NonNull
57 IDataTypeAdapter<?> getJavaTypeAdapter();
58
59 @Override
60 default Object deepCopyItem(Object source, IBoundObject parentInstance) throws BindingException {
61 return getJavaTypeAdapter().copy(source);
62 }
63 }