@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { if (Constants.TAG_NULL_TILE.equals(reader.getNodeName())) { Tile tile = new NullTile(); return tile; } else { String c0 = reader.getAttribute(Constants.ATTRIBUTE_TILE_C0); String c1 = reader.getAttribute(Constants.ATTRIBUTE_TILE_C1); Tile tile = new Tile(Color.valueOf(c0), Color.valueOf(c1)); return new TileXML(tile); } }
@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { String c0 = reader.getAttribute(Constants.ATTRIBUTE_PLACEMENT_C0); String d0 = reader.getAttribute(Constants.ATTRIBUTE_PLACEMENT_D0); String a0 = reader.getAttribute(Constants.ATTRIBUTE_PLACEMENT_A0); String c1 = reader.getAttribute(Constants.ATTRIBUTE_PLACEMENT_C1); String d1 = reader.getAttribute(Constants.ATTRIBUTE_PLACEMENT_D1); String a1 = reader.getAttribute(Constants.ATTRIBUTE_PLACEMENT_A1); Placement placement = new Placement( Color.valueOf(c0), Integer.valueOf(d0), Integer.valueOf(a0), Color.valueOf(c1), Integer.valueOf(d1), Integer.valueOf(a1)); return new PlacementXML(placement); }