com.hmsonline.json.transformer.JsonRuleList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-transformer Show documentation
Show all versions of json-transformer Show documentation
A json-2-json transformer library
The newest version!
package com.hmsonline.json.transformer;
import java.util.ArrayList;
import org.json.simple.JSONObject;
/**
* Chain of JsonRules
* @author baotran
*
*/
public class JsonRuleList implements JsonTransformer {
private ArrayList transformers = null;
public JsonRuleList() {
this.transformers = new ArrayList();
}
public void addRule(JsonRule rule) {
this.transformers.add(rule);
}
public void transform(JSONObject parent, Object targetKey) {
for(JsonTransformer r : this.transformers)
r.transform(parent, targetKey);
}
public void transform(Object root) {
for(JsonTransformer r : this.transformers)
r.transform(root);
}
}