org.jxls.builder.xml.SimpleConfigurator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jxls-jdk1.6 Show documentation
Show all versions of jxls-jdk1.6 Show documentation
Small library for Excel generation based on XLS templates
The newest version!
package org.jxls.builder.xml;
import ch.qos.logback.core.joran.GenericConfigurator;
import ch.qos.logback.core.joran.action.Action;
import ch.qos.logback.core.joran.action.ImplicitAction;
import ch.qos.logback.core.joran.spi.ElementSelector;
import ch.qos.logback.core.joran.spi.Interpreter;
import ch.qos.logback.core.joran.spi.RuleStore;
import java.util.List;
import java.util.Map;
/**
* Configurator used by XmlAreaBuilder to configure building rules
* @author Leonid Vysochyn
* Date: 2/14/12
*/
public class SimpleConfigurator extends GenericConfigurator {
final Map ruleMap;
final List iaList;
public SimpleConfigurator(Map ruleMap) {
this(ruleMap, null);
}
public SimpleConfigurator(Map ruleMap, List iaList) {
this.ruleMap = ruleMap;
this.iaList = iaList;
}
@Override
protected void addInstanceRules(RuleStore rs) {
for (ElementSelector pattern : ruleMap.keySet()) {
Action action = ruleMap.get(pattern);
rs.addRule(pattern, action);
}
}
@Override
protected void addImplicitRules(Interpreter interpreter) {
if(iaList == null) {
return;
}
for (ImplicitAction ia : iaList) {
interpreter.addImplicitAction(ia);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy