forked from fanruan/design
hades
4 years ago
4 changed files with 55 additions and 1 deletions
@ -0,0 +1,34 @@
|
||||
package com.fr.design.mod.impl.change; |
||||
|
||||
import com.fr.data.impl.NameTableData; |
||||
import com.fr.design.mod.ContentChange; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.design.mod.bean.ChangeItem; |
||||
import com.fr.design.mod.impl.repalce.NameTableDataContentReplacer; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class NameTableDataContentChange implements ContentChange<NameTableData> { |
||||
|
||||
private final Map<ChangeItem, ContentReplacer<NameTableData>> map; |
||||
|
||||
public NameTableDataContentChange() { |
||||
map = new HashMap<>(); |
||||
map.put(ChangeItem.TABLE_DATA_NAME, new NameTableDataContentReplacer()); |
||||
} |
||||
|
||||
@Override |
||||
public String type() { |
||||
return NameTableData.class.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Map<ChangeItem, ContentReplacer<NameTableData>> changeInfo() { |
||||
return map; |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.design.mod.impl.repalce; |
||||
|
||||
import com.fr.data.impl.NameTableData; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class NameTableDataContentReplacer implements ContentReplacer<NameTableData> { |
||||
|
||||
@Override |
||||
public void replace(NameTableData nameTableData, String oldName, String newName) { |
||||
nameTableData.rename(oldName, newName); |
||||
} |
||||
} |
Loading…
Reference in new issue