1 package org.apache.turbine.services.urlmapper.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.LinkedHashMap;
23 import java.util.Map;
24 import java.util.Set;
25 import java.util.regex.Pattern;
26
27 import javax.xml.bind.annotation.XmlAccessType;
28 import javax.xml.bind.annotation.XmlAccessorType;
29 import javax.xml.bind.annotation.XmlElement;
30 import javax.xml.bind.annotation.XmlType;
31 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
32
33 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
34 import com.fasterxml.jackson.annotation.JsonProperty;
35
36
37
38
39
40
41 @XmlType(name="map")
42 @XmlAccessorType(XmlAccessType.NONE)
43 @JsonIgnoreProperties(ignoreUnknown = true)
44 public class URLMapEntry
45 {
46 private Pattern urlPattern;
47 private Map<String, String> implicit = new LinkedHashMap<>();
48 private Map<String, String> ignore = new LinkedHashMap<>();
49 private Map<String, String> override = new LinkedHashMap<>();
50
51 private Map<String, Integer> groupNamesMap;
52 private Set<String> relevantKeys = null;
53
54
55
56
57 @XmlElement(name="pattern")
58 @XmlJavaTypeAdapter(XmlPatternAdapter.class)
59 @JsonProperty("pattern")
60 public Pattern getUrlPattern()
61 {
62 return urlPattern;
63 }
64
65
66
67
68 protected void setUrlPattern(Pattern urlPattern)
69 {
70 this.urlPattern = urlPattern;
71 }
72
73
74
75
76 @XmlElement(name="implicit-parameters")
77 @XmlJavaTypeAdapter(XmlParameterAdapter.class)
78 @JsonProperty("implicit-parameters")
79 public Map<String, String> getImplicitParameters()
80 {
81 return implicit;
82 }
83
84
85
86
87 protected void setImplicitParameters(Map<String, String> implicit)
88 {
89 this.implicit = implicit;
90 }
91
92
93
94
95 @XmlElement(name="ignore-parameters")
96 @XmlJavaTypeAdapter(XmlParameterAdapter.class)
97 @JsonProperty("ignore-parameters")
98 public Map<String, String> getIgnoreParameters()
99 {
100 return ignore;
101 }
102
103
104
105
106 protected void setIgnoreParameters(Map<String, String> ignore)
107 {
108 this.ignore = ignore;
109 }
110
111
112
113
114 @XmlElement(name="override-parameters")
115 @XmlJavaTypeAdapter(XmlParameterAdapter.class)
116 @JsonProperty("override-parameters")
117 public Map<String, String> getOverrideParameters()
118 {
119 return override;
120 }
121
122
123
124
125 protected void setOverrideParameters(Map<String, String> override)
126 {
127 this.override = override;
128 }
129
130
131
132
133
134
135 public Map<String, Integer> getGroupNamesMap()
136 {
137 return groupNamesMap;
138 }
139
140
141
142
143
144
145 public void setGroupNamesMap(Map<String, Integer> groupNamesMap)
146 {
147 this.groupNamesMap = groupNamesMap;
148 }
149
150
151
152
153
154
155 public Set<String> getRelevantKeys()
156 {
157 return relevantKeys;
158 }
159
160
161
162
163
164
165 public void setRelevantKeys(Set<String> relevantKeys)
166 {
167 this.relevantKeys = relevantKeys;
168 }
169
170 @Override
171 public String toString()
172 {
173 return "URLMapEntry: [ pattern: " + urlPattern + ", implicit-parameters: " + implicit + ", override-parameters: " + override + ", ignore-parameters:" + ignore + " ]";
174 }
175 }