예제 #1
0
 public Bundle createBundle(BundleFactory factory) {
   Bundle bundle = factory.createBundle();
   for (FieldValue fv : list) {
     bundle.setValue(bundle.getFormat().getField(fv.field.getName()), fv.value);
   }
   return bundle;
 }
예제 #2
0
 protected Bundle makeAltBundle(Bundle bundle) {
   ListBundleFormat format = new ListBundleFormat();
   Bundle alt = new ListBundle(format);
   for (int i = 0; i < columns.length; i++) {
     BundleField field = format.getField(columns[i]);
     alt.setValue(field, bundle.getValue(bundle.getFormat().getField(columns[i])));
   }
   return alt;
 }
예제 #3
0
 @Override
 public Bundle bundleize(Bundle next, String line) {
   List<String> row = tokens.tokenize(line);
   if (row == null) {
     return null;
   }
   int pos = 0;
   for (String col : row) {
     if (pos >= columns.length) {
       break;
     }
     ValueObject val = ValueFactory.create(col);
     if (tokenFilter != null) {
       val = tokenFilter.filter(val);
     }
     next.setValue(next.getFormat().getField(columns[pos++]), val);
   }
   return next;
 }
예제 #4
0
 protected void mergeBundles(Bundle orig, Bundle nBundle) {
   for (BundleField bf : nBundle) {
     orig.setValue(orig.getFormat().getField(bf.getName()), nBundle.getValue(bf));
   }
 }