Package org.apache.commons.digester3.plugins

Examples of org.apache.commons.digester3.plugins.PluginCreateRule


        digester.setRules( rc );

        PluginDeclarationRule pdr = new PluginDeclarationRule();
        digester.addRule( "root/plugin", pdr );

        PluginCreateRule pcr = new PluginCreateRule( ObjectTestImpl.class );
        digester.addRule( "root/object", pcr );

        try
        {
            digester.parse( new StringReader( input.toString() ) );
View Full Code Here


        digester.setRules( rc );

        PluginDeclarationRule pdr = new PluginDeclarationRule();
        digester.addRule( "root/plugin", pdr );

        PluginCreateRule pcr = new PluginCreateRule( Widget.class );
        digester.addRule( "root/widget", pcr );
        digester.addSetNext( "root/widget", "addChild" );

        Container root = new Container();
        digester.push( root );
View Full Code Here

        // same plugin rule (ie at the same pattern).
        Digester digester = new Digester();
        PluginRules rc = new PluginRules();
        digester.setRules( rc );

        PluginCreateRule pcr = new PluginCreateRule( Widget.class );
        digester.addRule( "root/widget", pcr );
        digester.addSetNext( "root/widget", "addChild" );

        Container root = new Container();
        digester.push( root );
View Full Code Here

        Digester digester = new Digester();
        PluginRules rc = new PluginRules();
        digester.setRules( rc );

        PluginCreateRule pcr = new PluginCreateRule( Widget.class );
        digester.addRule( "/root/widget", pcr );
        digester.addSetNext( "/root/widget", "addChild" );

        Container root = new Container();
        digester.push( root );
View Full Code Here

        digester.setRules( rc );

        PluginDeclarationRule pdr = new PluginDeclarationRule();
        digester.addRule( "root/plugin", pdr );

        PluginCreateRule pcr2 = new PluginCreateRule( Widget.class );
        digester.addRule( "root/widget", pcr2 );
        digester.addSetNext( "root/widget", "addChild" );

        Container root = new Container();
        digester.push( root );
View Full Code Here

        digester.setRules( rc );

        PluginDeclarationRule pdr = new PluginDeclarationRule();
        digester.addRule( "root/plugin", pdr );

        PluginCreateRule pcr2 = new PluginCreateRule( Widget.class );
        digester.addRule( "root/widget", pcr2 );
        digester.addSetNext( "root/widget", "addChild" );

        Container root = new Container();
        digester.push( root );
View Full Code Here

        if ( baseClass == null )
        {
            reportError( "createPlugin()", "'baseClass' has to be specified" );
        }

        PluginCreateRule rule;
        if ( dfltPluginClass != null )
        {
            if ( dfltPluginRuleLoader != null )
            {
                rule = new PluginCreateRule( baseClass, dfltPluginClass, dfltPluginRuleLoader );
            }
            else
            {
                rule = new PluginCreateRule( baseClass, dfltPluginClass );
            }
        }
        else
        {
            rule = new PluginCreateRule( baseClass );
        }

        for ( Entry<String, String> entry : pluginClassAttributes.entrySet() )
        {
            rule.setPluginClassAttribute( entry.getKey(), entry.getValue() );
        }

        for ( Entry<String, String> entry : pluginIdAttributes.entrySet() )
        {
            rule.setPluginIdAttribute( entry.getKey(), entry.getValue() );
        }

        return rule;
    }
View Full Code Here

    {
        // * tests that when a PluginCreateRule is defined with a default
        // class, that the default class is instantiated when no class
        // or id is specified in the xml file.
        Digester digester = new Digester();
        PluginRules rc = new PluginRules();
        digester.setRules( rc );

        PluginCreateRule pcr = new PluginCreateRule( Widget.class, TextLabel.class );
        digester.addRule( "root/widget", pcr );
        digester.addSetNext( "root/widget", "addChild" );
View Full Code Here

        throws Exception
    {
        // * tests that when there is no default plugin, it is an error
        // not to have one of plugin-class or plugin-id specified
        Digester digester = new Digester();
        PluginRules rc = new PluginRules();
        digester.setRules( rc );

        PluginCreateRule pcr = new PluginCreateRule( Widget.class );
        digester.addRule( "root/widget", pcr );
        digester.addSetNext( "root/widget", "addChild" );
View Full Code Here

        throws Exception
    {
        // * tests that the default plugin must implement or extend the
        // plugin base class.
        Digester digester = new Digester();
        PluginRules rc = new PluginRules();
        digester.setRules( rc );

        PluginCreateRule pcr = new PluginCreateRule( Widget.class, Object.class );
        digester.addRule( "root/widget", pcr );
        digester.addSetNext( "root/widget", "addChild" );
View Full Code Here

TOP

Related Classes of org.apache.commons.digester3.plugins.PluginCreateRule

Copyright © 2018 www.massapicom. 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.