[HepData-svn] r1884 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Jul 23 18:01:04 BST 2015


Author: watt
Date: Thu Jul 23 18:01:04 2015
New Revision: 1884

Log:
Changes to YAML formatter: x 'description' to 'value' and write y description if present

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java	Wed Jul 22 18:57:40 2015	(r1883)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java	Thu Jul 23 18:01:04 2015	(r1884)
@@ -386,7 +386,7 @@
                 }
                 if(bin.getDescription() != null ) {  
                     if(!first) { s.append(", "); } 
-                    s.append("description: '"+bin.getDescription()+"'");  
+                    s.append("value: '"+bin.getDescription()+"'");  
                     first=false;
                 }
                 if(bin.getId() < xax.getBins().size()) {
@@ -492,7 +492,11 @@
                         s.append(point.getRelation());
                     }
 		    //                    s.append(point.getValue()+" "+point.getValueLength()+"\n");
-		    s.append(point.getValue()+"\n");
+		    if (point.getDescription() != null) {
+			s.append(point.getDescription()+"\n");
+		    } else {
+			s.append(point.getValue()+"\n");
+		    }
 		    if(point.getErrors().size()>0){
                         s.append(s4+s4+"errors:\n");
                         for(Uncertainty error : point.getErrors()){


More information about the HepData-svn mailing list