1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package de.smartics.properties.api.core.domain;
17
18 import java.util.List;
19 import java.util.Locale;
20
21 import de.smartics.exceptions.i18n.message.MessageParam;
22 import de.smartics.properties.api.core.annotations.AccessType;
23 import de.smartics.properties.api.core.annotations.PropertyDefinitionTime;
24 import de.smartics.properties.api.core.annotations.PropertyUse.UseType;
25 import de.smartics.properties.api.core.app.PropertiesCode;
26
27
28
29
30 public class PropertyDescriptorMessageBean extends PropertyMessageBean
31 {
32
33
34
35
36
37
38
39
40
41
42 private static final long serialVersionUID = 1L;
43
44
45
46
47
48
49
50
51 @MessageParam("propertyDescriptorDeclaringType:declaringType,propertyKey:key")
52 private final PropertyDescriptor propertyDescriptor;
53
54
55
56
57
58
59
60
61
62
63
64
65
66 public PropertyDescriptorMessageBean(final PropertiesCode code,
67 final Throwable cause, final PropertyDescriptor propertyDescriptor)
68 {
69 super(code, cause, provide(propertyDescriptor).getKey());
70 this.propertyDescriptor = provide(propertyDescriptor);
71 }
72
73
74
75
76
77
78 private static final class DefaultPropertyDescriptor implements
79 PropertyDescriptor
80 {
81
82
83
84
85
86
87 private static final long serialVersionUID = 1L;
88
89 @Override
90 public PropertyContext getContext()
91 {
92 return null;
93 }
94
95 @Override
96 public Class<?> getDeclaringType()
97 {
98 return Void.class;
99 }
100
101 @Override
102 public PropertyKey getKey()
103 {
104 return new PropertyKey("n/a");
105 }
106
107 @Override
108 public PropertyType getType()
109 {
110 return null;
111 }
112
113 @Override
114 public boolean isMandatory()
115 {
116 return false;
117 }
118
119 @Override
120 public boolean isSecured()
121 {
122 return false;
123 }
124
125 @Override
126 public AccessType getAccessType()
127 {
128 return null;
129 }
130
131 @Override
132 public boolean isRuntimeMutable()
133 {
134 return false;
135 }
136
137 @Override
138 public long getUpdateIntervalInMs()
139 {
140 return 0;
141 }
142
143 @Override
144 public PropertyDefinitionTime getConfigurationTime()
145 {
146 return null;
147 }
148
149 @Override
150 public PropertyExpression getDefaultExpression()
151 {
152 return null;
153 }
154
155 @Override
156 public PropertyValueRange<?> getValueRange()
157 {
158 return null;
159 }
160
161 @Override
162 public List<? extends PropertyConstraint<?>> getConstraints()
163 {
164 return null;
165 }
166
167 @Override
168 public DocumentName getDocumentName()
169 {
170 return null;
171 }
172
173 @Override
174 public PropertyProjectdoc getDocumentMetaData()
175 {
176 return null;
177 }
178
179 @Override
180 public PropertyProjectdoc getDocumentMetaData(final Locale locale)
181 {
182 return null;
183 }
184
185 @Override
186 public PropertySetProjectdoc getDocumentMetaDataProjectSet()
187 {
188 return null;
189 }
190
191 @Override
192 public PropertySetProjectdoc getDocumentMetaDataProjectSet(
193 final Locale locale)
194 {
195 return null;
196 }
197
198 @Override
199 public PropertyComment getComment()
200 {
201 return null;
202 }
203
204 @Override
205 public PropertyComment getComment(final Locale locale)
206 {
207 return null;
208 }
209
210 @Override
211 public PropertyCategories getCategories()
212 {
213 return null;
214 }
215
216 @Override
217 public UseType getUseType()
218 {
219 return null;
220 }
221 }
222
223
224
225
226
227 private static PropertyDescriptor provide(
228 final PropertyDescriptor propertyDescriptor)
229 {
230 return propertyDescriptor != null ? propertyDescriptor
231 : new DefaultPropertyDescriptor();
232 }
233
234
235
236
237
238
239
240
241 public final PropertyDescriptor getPropertyDescriptor()
242 {
243 return propertyDescriptor;
244 }
245
246
247
248
249
250 }