comparison artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java @ 8862:5b5bdce5a216

Introduced new number formats for some new data types Also using varargs in msg helper methods
author gernotbelger
date Fri, 19 Jan 2018 18:47:18 +0100
parents 5e38e2924c07
children 791714b92b5c
comparison
equal deleted inserted replaced
8861:571e5287dfbb 8862:5b5bdce5a216
92 92
93 private NumberFormat wFormat; 93 private NumberFormat wFormat;
94 94
95 private NumberFormat qFormat; 95 private NumberFormat qFormat;
96 96
97 private NumberFormat meanBedHeightFormat;
98
99 private NumberFormat tkhFormat;
100
101 private NumberFormat flowDepthFormat;
102
103 private NumberFormat w2Format;
97 104
98 /** 105 /**
99 * Concrete subclasses need to use this method to write their special data 106 * Concrete subclasses need to use this method to write their special data
100 * objects into the CSV document. 107 * objects into the CSV document.
101 * 108 *
283 protected String getFacetFromRequest() { 290 protected String getFacetFromRequest() {
284 return XMLUtils.xpathString( 291 return XMLUtils.xpathString(
285 request, XPATH_FACET, ArtifactNamespaceContext.INSTANCE); 292 request, XPATH_FACET, ArtifactNamespaceContext.INSTANCE);
286 } 293 }
287 294
288 protected String msg(String key) { 295 protected String msg(final String key) {
289 return Resources.getMsg(context.getMeta(), key, key); 296 return Resources.getMsg(context.getMeta(), key, key);
290 } 297 }
291 298
292 protected String msg(String key, String def) { 299 protected String msg(String key, final String def) {
293 return Resources.getMsg(context.getMeta(), key, def); 300 return Resources.getMsg(context.getMeta(), key, def);
294 } 301 }
295 302
296 protected String msg(String key, Object[] args) { 303 protected String msg(final String key, final Object... args) {
297 return Resources.getMsg(context.getMeta(), key, key, args); 304 return Resources.getMsg(context.getMeta(), key, key, args);
298 } 305 }
299 306
300 protected String msg(String key, String def, Object[] args) { 307 protected String msg(final String key, final String def, final Object args) {
301 return Resources.getMsg(context.getMeta(), key, def, args); 308 return Resources.getMsg(context.getMeta(), key, def, args);
302 } 309 }
303 310
304 311
305 /** 312 /**
391 if (qFormat == null) { 398 if (qFormat == null) {
392 qFormat = Formatter.getWaterlevelQ(context); 399 qFormat = Formatter.getWaterlevelQ(context);
393 } 400 }
394 return qFormat; 401 return qFormat;
395 } 402 }
403
404 protected final NumberFormat getMeanBedHeighFormatter() {
405 if( meanBedHeightFormat == null )
406 meanBedHeightFormat = Formatter.getMeanBedHeight(context);
407 return meanBedHeightFormat;
408 }
409
410 protected final NumberFormat getTkhFormatter() {
411 if( tkhFormat == null )
412 tkhFormat = Formatter.getTkh(context);
413 return tkhFormat;
414 }
415
416 protected final NumberFormat getFlowDepthFormatter() {
417 if( flowDepthFormat == null )
418 flowDepthFormat = Formatter.getFlowDepth(context);
419 return flowDepthFormat;
420 }
421
422 protected final NumberFormat getW2Formatter() {
423 if( w2Format == null )
424 w2Format = Formatter.getFlowDepth(context);
425 return w2Format;
426 }
396 } 427 }
397 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 428 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org