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

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

Introduction

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

Prototype

public FactoryCreateRule(ObjectCreationFactory<?> creationFactory) 

Source Link

Document

Construct a factory create rule using the given, already instantiated, ObjectCreationFactory .

Usage

From source file:org.apache.hadoop.gateway.descriptor.xml.XmlGatewayDescriptorRules.java

@Override
protected void configure() {

    forPattern(GATEWAY).addRule(new FactoryCreateRule(XmlGatewayDescriptorFactory.class));
    forPattern(GATEWAY + "/" + RESOURCE).addRule(new AddNextRule("addResource"));
    forPattern(GATEWAY + "/" + RESOURCE + "/" + RESOURCE_ROLE).callMethod("role").usingElementBodyAsArgument();
    forPattern(GATEWAY + "/" + RESOURCE + "/" + RESOURCE_PATTERN).callMethod("pattern")
            .usingElementBodyAsArgument();
    forPattern(GATEWAY + "/" + RESOURCE + "/" + FILTER).addRule(new AddNextRule("addFilter"));
    forPattern(GATEWAY + "/" + RESOURCE + "/" + FILTER + "/" + FILTER_ROLE).callMethod("name")
            .usingElementBodyAsArgument();
    forPattern(GATEWAY + "/" + RESOURCE + "/" + FILTER + "/" + FILTER_ROLE).callMethod("role")
            .usingElementBodyAsArgument();
    forPattern(GATEWAY + "/" + RESOURCE + "/" + FILTER + "/" + FILTER_IMPL).callMethod("impl")
            .usingElementBodyAsArgument();
    forPattern(GATEWAY + "/" + RESOURCE + "/" + FILTER + "/" + FILTER_PARAM).addRule(new AddNextRule("param"));
    forPattern(GATEWAY + "/" + RESOURCE + "/" + FILTER + "/" + FILTER_PARAM + "/" + FILTER_PARAM_NAME)
            .callMethod("name").usingElementBodyAsArgument();
    forPattern(GATEWAY + "/" + RESOURCE + "/" + FILTER + "/" + FILTER_PARAM + "/" + FILTER_PARAM_VALUE)
            .callMethod("value").usingElementBodyAsArgument();
}