Examples of CallMethodRule


Examples of org.apache.commons.digester.CallMethodRule

                targetOffset = Integer.parseInt(targetOffsetStr);
            }

            if (attributes.getValue("paramcount") == null) {
                // call against empty method
                callMethodRule = new CallMethodRule(targetOffset, methodName);
           
            } else {
                int paramCount = Integer.parseInt(attributes.getValue("paramcount"));
               
                String paramTypesAttr = attributes.getValue("paramtypes");
                if (paramTypesAttr == null || paramTypesAttr.length() == 0) {
                    callMethodRule = new CallMethodRule(targetOffset, methodName, paramCount);
                } else {
                    String[] paramTypes = getParamTypes(paramTypesAttr);
                    callMethodRule = new CallMethodRule(
                        targetOffset, methodName, paramCount, paramTypes);
                }
            }
            return callMethodRule;
        }
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

        expander.addSource("$", mutableSource);
        digester.setSubstitutor(new VariableSubstitutor(expander));

        int useRootObj = -1;
        Class[] callerArgTypes = new Class[] {String.class, String.class};
        CallMethodRule caller = new CallMethodRule(useRootObj, "addProperty",
            callerArgTypes.length, callerArgTypes);
        digester.addRule("root/property", caller);
        digester.addCallParam("root/property", 0, "name");
        digester.addCallParam("root/property", 1, "value");
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

        public Object createObject(Attributes attributes) {
            Rule callMethodRule = null;
            String methodName = attributes.getValue("methodname");
            if (attributes.getValue("paramcount") == null) {
                // call against empty method
                callMethodRule = new CallMethodRule(methodName);
           
            } else {
                int paramCount = Integer.parseInt(attributes.getValue("paramcount"));
               
                String paramTypesAttr = attributes.getValue("paramtypes");
                if (paramTypesAttr == null || paramTypesAttr.length() == 0) {
                    callMethodRule = new CallMethodRule(methodName, paramCount);
                } else {
                    // Process the comma separated list or paramTypes
                    // into an array of String class names
                    ArrayList paramTypes = new ArrayList();
                    StringTokenizer tokens = new StringTokenizer(paramTypesAttr, " \t\n\r,");
                    while (tokens.hasMoreTokens()) {
                            paramTypes.add(tokens.nextToken());
                    }
                    callMethodRule = new CallMethodRule( methodName,
                                                        paramCount,
                                                        (String[])paramTypes.toArray(new String[0]));
                }
            }
            return callMethodRule;
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

    private String methodName = null;
    private int paramCount = -1;

    public Rule getDigesterRule() {
        CallMethodRule rule = new CallMethodRule(getMethodName(),getParamCount());
        return rule;
    }
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

        public Object createObject(Attributes attributes) {
            Rule callMethodRule = null;
            String methodName = attributes.getValue("methodname");
            if (attributes.getValue("paramcount") == null) {
                // call against empty method
                callMethodRule = new CallMethodRule(methodName);
           
            } else {
                int paramCount = Integer.parseInt(attributes.getValue("paramcount"));
               
                String paramTypesAttr = attributes.getValue("paramtypes");
                if (paramTypesAttr == null || paramTypesAttr.length() == 0) {
                    callMethodRule = new CallMethodRule(methodName, paramCount);
                } else {
                    // Process the comma separated list or paramTypes
                    // into an array of String class names
                    ArrayList paramTypes = new ArrayList();
                    StringTokenizer tokens = new StringTokenizer(paramTypesAttr, " \t\n\r,");
                    while (tokens.hasMoreTokens()) {
                            paramTypes.add(tokens.nextToken());
                    }
                    callMethodRule = new CallMethodRule( methodName,
                                                        paramCount,
                                                        (String[])paramTypes.toArray(new String[0]));
                }
            }
            return callMethodRule;
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

                targetOffset = Integer.parseInt(targetOffsetStr);
            }

            if (attributes.getValue("paramcount") == null) {
                // call against empty method
                callMethodRule = new CallMethodRule(targetOffset, methodName);
           
            } else {
                int paramCount = Integer.parseInt(attributes.getValue("paramcount"));
               
                String paramTypesAttr = attributes.getValue("paramtypes");
                if (paramTypesAttr == null || paramTypesAttr.length() == 0) {
                    callMethodRule = new CallMethodRule(targetOffset, methodName, paramCount);
                } else {
                    String[] paramTypes = getParamTypes(paramTypesAttr);
                    callMethodRule = new CallMethodRule(
                        targetOffset, methodName, paramCount, paramTypes);
                }
            }
            return callMethodRule;
        }
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

        expander.addSource("$", mutableSource);
        digester.setSubstitutor(new VariableSubstitutor(expander));

        int useRootObj = -1;
        Class<?>[] callerArgTypes = new Class[] {String.class, String.class};
        CallMethodRule caller = new CallMethodRule(useRootObj, "addProperty",
            callerArgTypes.length, callerArgTypes);
        digester.addRule("root/property", caller);
        digester.addCallParam("root/property", 0, "name");
        digester.addCallParam("root/property", 1, "value");
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

    /**
     * {@inheritDoc}
     */
    public CallMethodRule get() {
        return new CallMethodRule(this.methodName,
                this.parameterTypes.length,
                this.parameterTypes);
    }
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

                targetOffset = Integer.parseInt(targetOffsetStr);
            }

            if (attributes.getValue("paramcount") == null) {
                // call against empty method
                callMethodRule = new CallMethodRule(targetOffset, methodName);
           
            } else {
                int paramCount = Integer.parseInt(attributes.getValue("paramcount"));
               
                String paramTypesAttr = attributes.getValue("paramtypes");
                if (paramTypesAttr == null || paramTypesAttr.length() == 0) {
                    callMethodRule = new CallMethodRule(targetOffset, methodName, paramCount);
                } else {
                    String[] paramTypes = getParamTypes(paramTypesAttr);
                    callMethodRule = new CallMethodRule(
                        targetOffset, methodName, paramCount, paramTypes);
                }
            }
            return callMethodRule;
        }
View Full Code Here

Examples of org.apache.commons.digester.CallMethodRule

        expander.addSource("$", mutableSource);
        digester.setSubstitutor(new VariableSubstitutor(expander));

        int useRootObj = -1;
        Class[] callerArgTypes = new Class[] {String.class, String.class};
        CallMethodRule caller = new CallMethodRule(useRootObj, "addProperty",
            callerArgTypes.length, callerArgTypes);
        digester.addRule("root/property", caller);
        digester.addCallParam("root/property", 0, "name");
        digester.addCallParam("root/property", 1, "value");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.