BugFix for exportedMappings. ParentType also added for each mapping inside the json
@@ -232,18 +232,20 @@ public class ExtendedMultiMappingStore extends MultiMappingStore implements Iter
public List<MappingExportModel> exportModelList() {
List<MappingExportModel> exportList = new ArrayList<>();
- for (Mapping mapping : new ArrayList<>(getMappings())) {
+ for (Mapping mapping : getMappings()) {
MappingExportModel mappingExportModel = new MappingExportModel(
mapping.first.getType().name,
mapping.first.getLabel(),
mapping.first.getPos(),
mapping.first.getEndPos(),
mapping.first.hashCode(),
+ (mapping.first.getParent() == null) ? null : mapping.first.getParent().getType().name,
mapping.second.getType().name,
- mapping.first.getLabel(),
- mapping.first.getPos(),
- mapping.first.getEndPos(),
- mapping.second.hashCode()
+ mapping.second.getLabel(),
+ mapping.second.getPos(),
+ mapping.second.getEndPos(),
+ mapping.second.hashCode(),
+ (mapping.second.getParent() == null) ? null : mapping.second.getParent().getType().name
);
exportList.add(mappingExportModel);
}
@@ -267,12 +269,13 @@ public class ExtendedMultiMappingStore extends MultiMappingStore implements Iter
}
public static class MappingExportModel implements Serializable {
- String firstType,secondType,firstLabel,secondLabel;
+ String firstType,secondType,firstLabel,secondLabel,firstParentType,secondParentType;
int firstPos,secondPos,firstEndPos,secondEndPos;
@JsonIgnore
int firstHash,secondHash;
- public MappingExportModel(String firstType, String firstLabel,int firstPos,int firstEndPos, int firstHash,String secondType, String secondLabel, int secondPos, int secondEndPos, int secondHash) {
+ public MappingExportModel(String firstType, String firstLabel,int firstPos,int firstEndPos, int firstHash, String firstParentType,
+ String secondType, String secondLabel, int secondPos, int secondEndPos, int secondHash, String secondParentType) {
this.firstType = firstType;
this.secondType = secondType;
this.firstLabel = firstLabel;
@@ -283,6 +286,8 @@ public class ExtendedMultiMappingStore extends MultiMappingStore implements Iter
this.secondEndPos = secondEndPos;
this.firstHash = firstHash;
this.secondHash = secondHash;
+ this.firstParentType = firstParentType;
+ this.secondParentType = secondParentType;
}
public int getFirstHash() {
@@ -364,5 +369,21 @@ public class ExtendedMultiMappingStore extends MultiMappingStore implements Iter
public void setSecondEndPos(int secondEndPos) {
this.secondEndPos = secondEndPos;
}
+
+ public String getFirstParentType() {
+ return firstParentType;
+ }
+
+ public void setFirstParentType(String firstParentType) {
+ this.firstParentType = firstParentType;
+ }
+
+ public String getSecondParentType() {
+ return secondParentType;
+ }
+
+ public void setSecondParentType(String secondParentType) {
+ this.secondParentType = secondParentType;
+ }
}
}
