[Minor] added function for ignoring paramBags by type
This commit is contained in:
parent
00e41fdc4a
commit
ab0930eec8
|
@ -45,6 +45,7 @@ public class StrolchElementToJsonVisitor
|
||||||
|
|
||||||
private MapOfSets<String, String> ignoredKeys;
|
private MapOfSets<String, String> ignoredKeys;
|
||||||
private Set<String> ignoredStates;
|
private Set<String> ignoredStates;
|
||||||
|
private Set<String> ignoredBagTypes;
|
||||||
|
|
||||||
private BiConsumer<Resource, JsonObject> resourceHook;
|
private BiConsumer<Resource, JsonObject> resourceHook;
|
||||||
private BiConsumer<Order, JsonObject> orderHook;
|
private BiConsumer<Order, JsonObject> orderHook;
|
||||||
|
@ -60,6 +61,7 @@ public class StrolchElementToJsonVisitor
|
||||||
public StrolchElementToJsonVisitor() {
|
public StrolchElementToJsonVisitor() {
|
||||||
this.ignoredKeys = new MapOfSets<>();
|
this.ignoredKeys = new MapOfSets<>();
|
||||||
this.ignoredStates = new HashSet<>();
|
this.ignoredStates = new HashSet<>();
|
||||||
|
this.ignoredBagTypes = new HashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFlat() {
|
public boolean isFlat() {
|
||||||
|
@ -112,6 +114,11 @@ public class StrolchElementToJsonVisitor
|
||||||
this.ignoredKeys.addElement(bagId, paramId);
|
this.ignoredKeys.addElement(bagId, paramId);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StrolchElementToJsonVisitor ignoreBagParameterTyp(String type) {
|
||||||
|
this.ignoredBagTypes.add(type);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public StrolchElementToJsonVisitor resourceHook(BiConsumer<Resource, JsonObject> hook) {
|
public StrolchElementToJsonVisitor resourceHook(BiConsumer<Resource, JsonObject> hook) {
|
||||||
this.resourceHook = hook;
|
this.resourceHook = hook;
|
||||||
|
@ -335,6 +342,8 @@ public class StrolchElementToJsonVisitor
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ParameterBag parameterBag = element.getParameterBag(bagId);
|
ParameterBag parameterBag = element.getParameterBag(bagId);
|
||||||
|
if(ignoredBagTypes.contains(parameterBag.getType()))
|
||||||
|
continue;
|
||||||
|
|
||||||
Set<String> parameterKeySet = parameterBag.getParameterKeySet();
|
Set<String> parameterKeySet = parameterBag.getParameterKeySet();
|
||||||
for (String paramId : parameterKeySet) {
|
for (String paramId : parameterKeySet) {
|
||||||
|
|
Loading…
Reference in New Issue