changeset 7936:5ef60ed15c25

So you do not need to type every string twice.
author Tom Gottfried <tom@intevation.de>
date Tue, 17 Jun 2014 17:50:59 +0200
parents 6f8f13d829e5
children a310b1f85ce0
files artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java
diffstat 2 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java	Tue Jun 17 09:54:40 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java	Tue Jun 17 17:50:59 2014 +0200
@@ -263,6 +263,9 @@
             request, XPATH_FACET, ArtifactNamespaceContext.INSTANCE);
     }
 
+    protected String msg(String key) {
+        return Resources.getMsg(context.getMeta(), key, key);
+    }
 
     protected String msg(String key, String def) {
         return Resources.getMsg(context.getMeta(), key, def);
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Tue Jun 17 09:54:40 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Tue Jun 17 17:50:59 2014 +0200
@@ -130,17 +130,17 @@
 
     protected void writeCSVHeader(CSVWriter writer) {
         writer.writeNext(new String[] {
-            msg(CSV_KM        , CSV_KM),
-            msg(CSV_PARAMETER,  CSV_PARAMETER),
-            msg(CSV_COEFF_A   , CSV_COEFF_A),
-            msg(CSV_COEFF_B   , CSV_COEFF_B),
-            msg(CSV_SD, CSV_SD),
-            msg(CSV_QMAX, CSV_QMAX),
-            msg(CSV_COEFF_R, CSV_COEFF_R),
-            msg(CSV_N_TOTAL   , CSV_N_TOTAL),
-            msg(CSV_N_OUTLIERS, CSV_N_OUTLIERS),
-            msg(CSV_C_DUAN, CSV_C_DUAN),
-            msg(CSV_C_FERGUSON, CSV_C_FERGUSON)
+            msg(CSV_KM),
+            msg(CSV_PARAMETER),
+            msg(CSV_COEFF_A),
+            msg(CSV_COEFF_B),
+            msg(CSV_SD),
+            msg(CSV_QMAX),
+            msg(CSV_COEFF_R),
+            msg(CSV_N_TOTAL),
+            msg(CSV_N_OUTLIERS),
+            msg(CSV_C_DUAN),
+            msg(CSV_C_FERGUSON)
         });
     }
 

http://dive4elements.wald.intevation.org