All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hmsonline.json.transformer.JsonRuleList Maven / Gradle / Ivy

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy