Package org.apache.commons.digester3

Examples of org.apache.commons.digester3.Digester.addObjectCreate()


        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" );

        digester.addObjectCreate( "root/bean", SimpleTestBean.class );
        digester.addSetProperties( "root/bean" );
        digester.addSetNext( "root/bean", "addSimpleTestBean" );
        return digester;
    }
View Full Code Here


        digester.addObjectCreate( "toplevel", ArrayList.class );
        digester.addObjectCreate( "toplevel/one", Address.class );
        digester.addSetNext( "toplevel/one", "add" );
        digester.addObjectCreate( "toplevel/two", Address.class );
        digester.addSetNext( "toplevel/two", "add" );
        digester.addObjectCreate( "toplevel/three", Address.class );
        digester.addSetNext( "toplevel/three", "add" );
        digester.addObjectCreate( "toplevel/four", Address.class );
        digester.addSetNext( "toplevel/four", "add" );
        digester.addSetProperties( "toplevel/one" );
        digester.addSetProperties( "toplevel/two", new String[] { "alt-street", "alt-city", "alt-state" },
View Full Code Here

        digester.addSetNext( "toplevel/one", "add" );
        digester.addObjectCreate( "toplevel/two", Address.class );
        digester.addSetNext( "toplevel/two", "add" );
        digester.addObjectCreate( "toplevel/three", Address.class );
        digester.addSetNext( "toplevel/three", "add" );
        digester.addObjectCreate( "toplevel/four", Address.class );
        digester.addSetNext( "toplevel/four", "add" );
        digester.addSetProperties( "toplevel/one" );
        digester.addSetProperties( "toplevel/two", new String[] { "alt-street", "alt-city", "alt-state" },
                                   new String[] { "street", "city", "state" } );
        digester.addSetProperties( "toplevel/three", new String[] { "aCity", "state" }, new String[] { "city" } );
View Full Code Here

        String xml = "<root alpha='${attr1}' beta='var{attr2}'/>";
        StringReader input = new StringReader( xml );
        Digester digester = new Digester();

        // Configure the digester as required
        digester.addObjectCreate( "root", SimpleTestBean.class );
        digester.addSetProperties( "root" );

        // Parse our test input.
        SimpleTestBean root = digester.parse( input );
View Full Code Here

        Digester digester = new Digester();

        // Configure the digester as required
        MultiVariableExpander expander = new MultiVariableExpander();
        digester.setSubstitutor( new VariableSubstitutor( expander ) );
        digester.addObjectCreate( "root", SimpleTestBean.class );
        digester.addSetProperties( "root" );

        // Parse our test input.
        SimpleTestBean root = digester.parse( input );
View Full Code Here

        MultiVariableExpander expander = new MultiVariableExpander();
        expander.addSource( "$", source1 );
        expander.addSource( "var", source2 );

        digester.setSubstitutor( new VariableSubstitutor( expander ) );
        digester.addObjectCreate( "root/bean", SimpleTestBean.class );
        digester.addSetProperties( "root/bean" );
        digester.addSetNext( "root/bean", "addSimpleTestBean" );

        // Parse our test input.
        this.simpleTestBeans.clear();
View Full Code Here

        MultiVariableExpander expander = new MultiVariableExpander();
        expander.addSource( "noun", nouns );
        expander.addSource( "verb", verbs );
        digester.setSubstitutor( new VariableSubstitutor( expander ) );

        digester.addObjectCreate( "root", SimpleTestBean.class );
        digester.addCallMethod( "root", "setAlpha", 0 );

        // Parse our test input.
        SimpleTestBean root = digester.parse( input );
View Full Code Here

        // Configure the digester as required
        MultiVariableExpander expander = new MultiVariableExpander();
        expander.addSource( "$", new HashMap<String, Object>() );
        digester.setSubstitutor( new VariableSubstitutor( expander ) );

        digester.addObjectCreate( "root", SimpleTestBean.class );
        digester.addSetProperties( "root" );

        // Parse our test input.
        try
        {
View Full Code Here

        Digester digester = new Digester();
        digester.setValidating(false);
        digester.setClassLoader(FindBugsParser.class.getClassLoader());

        String rootXPath = "BugCollection/BugInstance";
        digester.addObjectCreate(rootXPath, XmlBugInstance.class);
        digester.addSetProperties(rootXPath);

        String fileXPath = rootXPath + "/LongMessage";
        digester.addCallMethod(fileXPath, "setMessage", 0);
View Full Code Here

        List<Pattern> patterns = new ArrayList<Pattern>();
        digester.push(patterns);

        String startPattern = "*/BugPattern";
        digester.addObjectCreate(startPattern, Pattern.class);
        digester.addSetProperties(startPattern);
        digester.addCallMethod("*/BugPattern/Details", "setDescription", 0);
        digester.addCallMethod("*/BugPattern/ShortDescription", "setShortDescription", 0);
        digester.addSetNext(startPattern, "add");

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.