1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.primefaces.extensions.model.monacoeditor;
25
26 import org.primefaces.shaded.json.*;
27 import java.io.ObjectStreamException;
28 import java.io.Serializable;
29
30
31
32
33
34
35
36
37 @SuppressWarnings("serial")
38 public class EditorSmartSelectOptions extends JSONObject implements Serializable {
39 private Object writeReplace() throws ObjectStreamException {
40 return new SerializedEditorSmartSelectOptions(this);
41 }
42
43 private static class SerializedEditorSmartSelectOptions implements Serializable {
44 private String json;
45
46 public SerializedEditorSmartSelectOptions(EditorSmartSelectOptions editorSmartSelectOptions) {
47 this.json = editorSmartSelectOptions.toString();
48 }
49
50 private Object readResolve() throws ObjectStreamException {
51 final EditorSmartSelectOptions editorSmartSelectOptions = new EditorSmartSelectOptions();
52 final JSONObject data = new JSONObject(json);
53 for (final String key : data.keySet()) {
54 final Object value = data.get(key);
55 editorSmartSelectOptions.put(key, value);
56 }
57 return editorSmartSelectOptions;
58 }
59 }
60
61 public Boolean isSelectLeadingAndTrailingWhitespace() {
62 return (Boolean) (has("selectLeadingAndTrailingWhitespace") ? get("selectLeadingAndTrailingWhitespace") : null);
63 }
64
65 public EditorSmartSelectOptions setSelectLeadingAndTrailingWhitespace(final Boolean selectLeadingAndTrailingWhitespace) {
66 put("selectLeadingAndTrailingWhitespace", selectLeadingAndTrailingWhitespace);
67 return this;
68 }
69
70 public Boolean isSelectSubwords() {
71 return (Boolean) (has("selectSubwords") ? get("selectSubwords") : null);
72 }
73
74 public EditorSmartSelectOptions setSelectSubwords(final Boolean selectSubwords) {
75 put("selectSubwords", selectSubwords);
76 return this;
77 }
78
79
80
81
82 JSONObject getJSONObject() {
83 return this;
84 }
85 }