Java Code Examples for org.apache.tomcat.util.digester.Digester#addCallParam()

The following examples show how to use org.apache.tomcat.util.digester.Digester#addCallParam() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TldRuleSet.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
public void addRuleInstances(Digester digester) {

    digester.addCallMethod(PREFIX + "/tlibversion", "setTlibVersion", 0);
    digester.addCallMethod(PREFIX + "/tlib-version", "setTlibVersion", 0);
    digester.addCallMethod(PREFIX + "/jspversion", "setJspVersion", 0);
    digester.addCallMethod(PREFIX + "/jsp-version", "setJspVersion", 0);
    digester.addRule(PREFIX, new Rule() {
        // for TLD 2.0 and later, jsp-version is set by version attribute
        @Override
        public void begin(String namespace, String name, Attributes attributes) {
            TaglibXml taglibXml = (TaglibXml) digester.peek();
            taglibXml.setJspVersion(attributes.getValue("version"));
        }
    });
    digester.addCallMethod(PREFIX + "/shortname", "setShortName", 0);
    digester.addCallMethod(PREFIX + "/short-name", "setShortName", 0);

    // common rules
    digester.addCallMethod(PREFIX + "/uri", "setUri", 0);
    digester.addCallMethod(PREFIX + "/info", "setInfo", 0);
    digester.addCallMethod(PREFIX + "/description", "setInfo", 0);
    digester.addCallMethod(PREFIX + "/listener/listener-class", "addListener", 0);

    // validator
    digester.addObjectCreate(VALIDATOR_PREFIX, ValidatorXml.class.getName());
    digester.addCallMethod(VALIDATOR_PREFIX + "/validator-class", "setValidatorClass", 0);
    digester.addCallMethod(VALIDATOR_PREFIX + "/init-param", "addInitParam", 2);
    digester.addCallParam(VALIDATOR_PREFIX + "/init-param/param-name", 0);
    digester.addCallParam(VALIDATOR_PREFIX + "/init-param/param-value", 1);
    digester.addSetNext(VALIDATOR_PREFIX, "setValidator", ValidatorXml.class.getName());


    // tag
    digester.addObjectCreate(TAG_PREFIX, TagXml.class.getName());
    addDescriptionGroup(digester, TAG_PREFIX);
    digester.addCallMethod(TAG_PREFIX + "/name", "setName", 0);
    digester.addCallMethod(TAG_PREFIX + "/tagclass", "setTagClass", 0);
    digester.addCallMethod(TAG_PREFIX + "/tag-class", "setTagClass", 0);
    digester.addCallMethod(TAG_PREFIX + "/teiclass", "setTeiClass", 0);
    digester.addCallMethod(TAG_PREFIX + "/tei-class", "setTeiClass", 0);
    digester.addCallMethod(TAG_PREFIX + "/bodycontent", "setBodyContent", 0);
    digester.addCallMethod(TAG_PREFIX + "/body-content", "setBodyContent", 0);

    digester.addRule(TAG_PREFIX + "/variable", new ScriptVariableRule());
    digester.addCallMethod(TAG_PREFIX + "/variable/name-given", "setNameGiven", 0);
    digester.addCallMethod(TAG_PREFIX + "/variable/name-from-attribute",
            "setNameFromAttribute", 0);
    digester.addCallMethod(TAG_PREFIX + "/variable/variable-class", "setClassName", 0);
    digester.addRule(TAG_PREFIX + "/variable/declare",
            new GenericBooleanRule(Variable.class, "setDeclare"));
    digester.addCallMethod(TAG_PREFIX + "/variable/scope", "setScope", 0);

    digester.addRule(TAG_PREFIX + "/attribute", new TagAttributeRule());
    digester.addCallMethod(TAG_PREFIX + "/attribute/description", "setDescription", 0);
    digester.addCallMethod(TAG_PREFIX + "/attribute/name", "setName", 0);
    digester.addRule(TAG_PREFIX + "/attribute/required",
            new GenericBooleanRule(Attribute.class, "setRequired"));
    digester.addRule(TAG_PREFIX + "/attribute/rtexprvalue",
            new GenericBooleanRule(Attribute.class, "setRequestTime"));
    digester.addCallMethod(TAG_PREFIX + "/attribute/type", "setType", 0);
    digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-value", "setDeferredValue");
    digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-value/type",
            "setExpectedTypeName", 0);
    digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-method", "setDeferredMethod");
    digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-method/method-signature",
            "setMethodSignature", 0);
    digester.addRule(TAG_PREFIX + "/attribute/fragment",
            new GenericBooleanRule(Attribute.class, "setFragment"));

    digester.addRule(TAG_PREFIX + "/dynamic-attributes",
            new GenericBooleanRule(TagXml.class, "setDynamicAttributes"));
    digester.addSetNext(TAG_PREFIX, "addTag", TagXml.class.getName());

    // tag-file
    digester.addObjectCreate(TAGFILE_PREFIX, TagFileXml.class.getName());
    addDescriptionGroup(digester, TAGFILE_PREFIX);
    digester.addCallMethod(TAGFILE_PREFIX + "/name", "setName", 0);
    digester.addCallMethod(TAGFILE_PREFIX + "/path", "setPath", 0);
    digester.addSetNext(TAGFILE_PREFIX, "addTagFile", TagFileXml.class.getName());

    // function
    digester.addCallMethod(FUNCTION_PREFIX, "addFunction", 3);
    digester.addCallParam(FUNCTION_PREFIX + "/name", 0);
    digester.addCallParam(FUNCTION_PREFIX + "/function-class", 1);
    digester.addCallParam(FUNCTION_PREFIX + "/function-signature", 2);
}
 
Example 2
Source File: TagPluginParser.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
public void addRuleInstances(Digester digester) {
    digester.addCallMethod(PREFIX, "addPlugin", 2);
    digester.addCallParam(PREFIX + "/tag-class", 0);
    digester.addCallParam(PREFIX + "/plugin-class", 1);
}
 
Example 3
Source File: WebRuleSet.java    From Tomcat8-Source-Read with MIT License 3 votes vote down vote up
protected void configureInjectionRules(Digester digester, String base) {

        digester.addCallMethod(prefix + base + "injection-target", "addInjectionTarget", 2);
        digester.addCallParam(prefix + base + "injection-target/injection-target-class", 0);
        digester.addCallParam(prefix + base + "injection-target/injection-target-name", 1);

    }
 
Example 4
Source File: WebRuleSet.java    From Tomcat7.0.67 with Apache License 2.0 3 votes vote down vote up
protected void configureInjectionRules(Digester digester, String base) {

        digester.addCallMethod(prefix + base + "injection-target", "addInjectionTarget", 2);
        digester.addCallParam(prefix + base + "injection-target/injection-target-class", 0);
        digester.addCallParam(prefix + base + "injection-target/injection-target-name", 1);

    }
 
Example 5
Source File: WebRuleSet.java    From tomcatsrc with Apache License 2.0 3 votes vote down vote up
protected void configureInjectionRules(Digester digester, String base) {

        digester.addCallMethod(prefix + base + "injection-target", "addInjectionTarget", 2);
        digester.addCallParam(prefix + base + "injection-target/injection-target-class", 0);
        digester.addCallParam(prefix + base + "injection-target/injection-target-name", 1);

    }