Example usage for org.apache.commons.digester3 SetPropertiesRule SetPropertiesRule

List of usage examples for org.apache.commons.digester3 SetPropertiesRule SetPropertiesRule

Introduction

In this page you can find the example usage for org.apache.commons.digester3 SetPropertiesRule SetPropertiesRule.

Prototype

public SetPropertiesRule(String[] attributeNames, String[] propertyNames) 

Source Link

Document

Constructor allows attribute->property mapping to be overriden.

Usage

From source file:net.sf.mcf2pdf.mcfelements.util.DigesterUtil.java

public static void addSetProperties(Digester digester, String pattern, List<String[]> specialAttributes) {
    String[] attrNames = new String[specialAttributes.size()];
    String[] propNames = new String[specialAttributes.size()];

    for (int i = 0; i < specialAttributes.size(); i++) {
        attrNames[i] = specialAttributes.get(i)[0];
        propNames[i] = specialAttributes.get(i)[1];
    }//from  w  w  w .j av a  2  s. com

    SetPropertiesRule rule = new SetPropertiesRule(attrNames, propNames);
    rule.setIgnoreMissingProperty(true);
    digester.addRule(pattern, rule);
}