|
1 | | -package goc.webtemplate; |
2 | | - |
3 | | -import java.io.Serializable; |
4 | | -import java.util.HashMap; |
5 | | - |
6 | | -import com.google.gson.annotations.JsonAdapter; |
7 | | - |
8 | | -/** |
9 | | - * Holds confirugration properties for the Custom Search feature of the |
10 | | - * application template. |
11 | | - */ |
12 | | -@SuppressWarnings("serial") |
13 | | -public class CustomSearch implements Serializable { |
14 | | - |
15 | | - private String action; |
16 | | - private String placeholder; |
17 | | - private String id; |
18 | | - private String method; |
19 | | - //NOTE: Custom serialization/adapter because value is serialized as a list of name+value tupples |
20 | | - @JsonAdapter(goc.webtemplate.component.jsonentities.adapters.HashMapAdapter.class) |
21 | | - private HashMap<String, String> hiddenInput; |
22 | | - |
23 | | - public CustomSearch() { |
24 | | - } |
25 | | - |
26 | | - public CustomSearch(String action, String placeholder, String id, String method) { |
27 | | - this.action = action; |
28 | | - this.placeholder = placeholder; |
29 | | - this.id = id; |
30 | | - this.method = method; |
31 | | - } |
32 | | - |
33 | | - /** |
34 | | - * Returns the path to the action attribute. |
35 | | - * @return action value |
36 | | - */ |
37 | | - public String getAction() { |
38 | | - return action; |
39 | | - } |
40 | | - |
41 | | - /** |
42 | | - * Sets the path to the action attribute. |
43 | | - */ |
44 | | - public void setAction(String action) { |
45 | | - this.action = action; |
46 | | - } |
47 | | - |
48 | | - /** |
49 | | - * Returns the text for the search label, placeholder and hidden heading. If not set, the text "search" will be used for all the text. |
50 | | - * @return the placeHolder value |
51 | | - */ |
52 | | - public String getPlaceholder() { |
53 | | - return placeholder; |
54 | | - } |
55 | | - |
56 | | - /** |
57 | | - * Sets the text for the search label, placeholder and hidden heading. If not set, the text "search" will be used for all the text. |
58 | | - */ |
59 | | - public void setPlaceholder(String placeHolder) { |
60 | | - this.placeholder = placeHolder; |
61 | | - } |
62 | | - |
63 | | - /** |
64 | | - * Returns the (optional) id to usefor the search input field, also used in the `for` attribute for the search label. |
65 | | - * @return the id value |
66 | | - */ |
67 | | - public String getId() { |
68 | | - return id; |
69 | | - } |
70 | | - |
71 | | - /** |
72 | | - * Sets the (optional) id to usefor the search input field, also used in the `for` attribute for the search label. |
73 | | - */ |
74 | | - public void setId(String id) { |
75 | | - this.id = id; |
76 | | - } |
77 | | - |
78 | | - /** |
79 | | - * Returns the HTTP method to be used when submitting the search action (e.g. GET or POST) |
80 | | - * @return the method value |
81 | | - */ |
82 | | - public String getMethod() { |
83 | | - return method; |
84 | | - } |
85 | | - |
86 | | - /** |
87 | | - * Returns the HTTP method to be used when submitting the search action (e.g. GET or POST) |
88 | | - */ |
89 | | - public void setMethod(String method) { |
90 | | - this.method = method; |
91 | | - } |
92 | | - |
93 | | - /** |
94 | | - * Returns the (optional) hidden form input fields. |
95 | | - */ |
96 | | - public HashMap<String, String> getHiddenInput() { |
97 | | - return hiddenInput; |
98 | | - } |
99 | | - |
100 | | - /** |
101 | | - * Sets the (optional) hidden form input fields. |
102 | | - */ |
103 | | - public void setHiddenInput(HashMap<String, String> hiddenInput) { |
104 | | - this.hiddenInput = hiddenInput; |
105 | | - } |
106 | | -} |
| 1 | +package goc.webtemplate; |
| 2 | + |
| 3 | +import java.io.Serializable; |
| 4 | +import java.util.Map; |
| 5 | + |
| 6 | +import com.google.gson.annotations.JsonAdapter; |
| 7 | + |
| 8 | +/** |
| 9 | + * Holds confirugration properties for the Custom Search feature of the |
| 10 | + * application template. |
| 11 | + */ |
| 12 | +@SuppressWarnings("serial") |
| 13 | +public class CustomSearch implements Serializable { |
| 14 | + |
| 15 | + private String action; |
| 16 | + private String placeholder; |
| 17 | + private String id; |
| 18 | + private String method; |
| 19 | + //NOTE: Custom serialization/adapter because value is serialized as a list of name+value tupples |
| 20 | + @JsonAdapter(goc.webtemplate.component.jsonentities.adapters.MapAdapter.class) |
| 21 | + private Map<String, String> hiddenInput; |
| 22 | + |
| 23 | + public CustomSearch() { |
| 24 | + } |
| 25 | + |
| 26 | + public CustomSearch(String action, String placeholder, String id, String method) { |
| 27 | + this.action = action; |
| 28 | + this.placeholder = placeholder; |
| 29 | + this.id = id; |
| 30 | + this.method = method; |
| 31 | + } |
| 32 | + |
| 33 | + /** |
| 34 | + * Returns the path to the action attribute. |
| 35 | + * @return action value |
| 36 | + */ |
| 37 | + public String getAction() { |
| 38 | + return action; |
| 39 | + } |
| 40 | + |
| 41 | + /** |
| 42 | + * Sets the path to the action attribute. |
| 43 | + */ |
| 44 | + public void setAction(String action) { |
| 45 | + this.action = action; |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * Returns the text for the search label, placeholder and hidden heading. If not set, the text "search" will be used for all the text. |
| 50 | + * @return the placeHolder value |
| 51 | + */ |
| 52 | + public String getPlaceholder() { |
| 53 | + return placeholder; |
| 54 | + } |
| 55 | + |
| 56 | + /** |
| 57 | + * Sets the text for the search label, placeholder and hidden heading. If not set, the text "search" will be used for all the text. |
| 58 | + */ |
| 59 | + public void setPlaceholder(String placeHolder) { |
| 60 | + this.placeholder = placeHolder; |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * Returns the (optional) id to usefor the search input field, also used in the `for` attribute for the search label. |
| 65 | + * @return the id value |
| 66 | + */ |
| 67 | + public String getId() { |
| 68 | + return id; |
| 69 | + } |
| 70 | + |
| 71 | + /** |
| 72 | + * Sets the (optional) id to usefor the search input field, also used in the `for` attribute for the search label. |
| 73 | + */ |
| 74 | + public void setId(String id) { |
| 75 | + this.id = id; |
| 76 | + } |
| 77 | + |
| 78 | + /** |
| 79 | + * Returns the HTTP method to be used when submitting the search action (e.g. GET or POST) |
| 80 | + * @return the method value |
| 81 | + */ |
| 82 | + public String getMethod() { |
| 83 | + return method; |
| 84 | + } |
| 85 | + |
| 86 | + /** |
| 87 | + * Returns the HTTP method to be used when submitting the search action (e.g. GET or POST) |
| 88 | + */ |
| 89 | + public void setMethod(String method) { |
| 90 | + this.method = method; |
| 91 | + } |
| 92 | + |
| 93 | + /** |
| 94 | + * Returns the (optional) hidden form input fields. |
| 95 | + */ |
| 96 | + public Map<String, String> getHiddenInput() { |
| 97 | + return hiddenInput; |
| 98 | + } |
| 99 | + |
| 100 | + /** |
| 101 | + * Sets the (optional) hidden form input fields. |
| 102 | + */ |
| 103 | + public void setHiddenInput(Map<String, String> hiddenInput) { |
| 104 | + this.hiddenInput = hiddenInput; |
| 105 | + } |
| 106 | +} |
0 commit comments