Package org.apache.beehive.netui.util.config.bean

Examples of org.apache.beehive.netui.util.config.bean.CommandConfig


        CatalogFactory catalogFactory = getInstance();
        assert catalogFactory != null;
        Catalog catalog = new CatalogBase();
        List chainConfigs = catalogConfig.getCommands();
        for(int i = 0; i < chainConfigs.size(); i++) {
            CommandConfig commandConfig = (CommandConfig)chainConfigs.get(i);
            assert commandConfig != null;

            if(commandConfig instanceof ChainConfig) {
                ChainConfig chainConfig = (ChainConfig)commandConfig;
                Chain chain = new ChainBase();

                List commandConfigs = chainConfig.getCommands();
                for(int j = 0; j < commandConfigs.size(); j++) {
                    CommandConfig chainCommandConfig = (CommandConfig)commandConfigs.get(j);
                    Command command = createCommand(chainCommandConfig);
                    chain.addCommand(command);
                }
                catalog.addCommand(chainConfig.getName(), chain);
            }
View Full Code Here


                        NodeList commandList = element.getElementsByTagName("command");
                        if(commandList != null) {
                            for(int j = 0; j < commandList.getLength(); j++) {
                                Element commandElement = (Element)commandList.item(j);
                                CommandConfig commandConfig = parseCommand(commandElement);
                                chainConfig.addCommand(commandConfig);
                            }
                        }
                        catalogConfig.addCommand(chainConfig);
                    }
                    else if(node.getNodeName().equals("command")) {
                        Element element = (Element)node;
                        CommandConfig commandConfig = parseCommand(element);
                        catalogConfig.addCommand(commandConfig);
                    }
                }
            }
        }
View Full Code Here

    private static CommandConfig parseCommand(Element element) {
        assert element != null;
        assert element.getNodeName().equals("command");

        CommandConfig commandConfig = new CommandConfig();
        String id = DomUtils.getChildElementText(element, "id");
        String classname = DomUtils.getChildElementText(element, "command-class");
        commandConfig.setId(id);
        commandConfig.setClassname(classname);

        NodeList propertyList = element.getElementsByTagName("custom-property");
        if(propertyList != null) {
            for(int k = 0; k < propertyList.getLength(); k++) {
                Element propertyElement = (Element)propertyList.item(k);
                String propName = DomUtils.getChildElementText(propertyElement, "name");
                String propValue = DomUtils.getChildElementText(propertyElement, "value");
                CustomPropertyConfig propertyConfig = new CustomPropertyConfig(propName, propValue);
                commandConfig.addParameter(propertyConfig);
            }
        }

        return commandConfig;
    }
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.util.config.bean.CommandConfig

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.