2
* Copyright (C) 2008 Steve Ratcliffe
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
14
* Author: Steve Ratcliffe
15
* Create date: 29-Nov-2008
17
package uk.me.parabola.mkgmap.osmstyle.actions;
19
import uk.me.parabola.mkgmap.reader.osm.Element;
22
* Renames a tag. Specifically takes the value of the 'from' tag, sets
23
* the value of the 'to' tag and removes the 'from' tag.
24
* @author Steve Ratcliffe
26
public class RenameAction implements Action {
27
private final String from;
28
private final String to;
30
public RenameAction(String from, String to) {
35
public void perform(Element el) {
36
String fromval = el.getTag(from);
37
if (fromval != null) {
38
el.addTag(to, fromval);