Example usage for org.apache.commons.digester SetNestedPropertiesRule SetNestedPropertiesRule

List of usage examples for org.apache.commons.digester SetNestedPropertiesRule SetNestedPropertiesRule

Introduction

In this page you can find the example usage for org.apache.commons.digester SetNestedPropertiesRule SetNestedPropertiesRule.

Prototype

public SetNestedPropertiesRule() 

Source Link

Document

Base constructor, which maps every child element into a bean property with the same name as the xml element.

Usage

From source file:org.sipfoundry.sipxconfig.admin.commserver.imdb.ImdbXmlHelper.java

public static Digester configureDigester(Class itemClass) {
    Digester digester = new Digester();
    digester.setValidating(false);/*from   www .  j a va2  s.c o  m*/
    digester.setNamespaceAware(false);

    digester.addObjectCreate("items", ArrayList.class);

    digester.addObjectCreate(ImdbXmlHelper.PATTERN, itemClass);
    SetNestedPropertiesRule rule = new SetNestedPropertiesRule();
    // ignore all properties that we are not interested in
    rule.setAllowUnknownChildElements(true);
    digester.addRule(ImdbXmlHelper.PATTERN, rule);
    digester.addSetNext(ImdbXmlHelper.PATTERN, "add");

    return digester;
}