01: /*
02: * Created on Apr 11, 2006
03: */
04: package uk.org.ponder.mapping;
05:
06: import uk.org.ponder.conversion.LeafObjectParser;
07:
08: public class LeafObjectDARReshaper implements DARReshaper {
09:
10: private LeafObjectParser parser;
11:
12: public LeafObjectDARReshaper(LeafObjectParser parser) {
13: this .parser = parser;
14: }
15:
16: public DataAlterationRequest reshapeDAR(
17: DataAlterationRequest toshape) {
18: String leafdata = toshape.data instanceof String[] ? ((String[]) toshape.data)[0]
19: : (String) toshape.data;
20: DataAlterationRequest togo = new DataAlterationRequest(
21: toshape.path, parser.parse(leafdata), toshape.type);
22: return togo;
23: }
24:
25: }
|