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

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


        assert factoryMap != null;

        NetuiConfig config = ConfigUtil.getConfig();
        assert config != null;

        ExpressionLanguages languages = config.getExpressionLanguages();
        assert languages != null;

        ExpressionLanguage[] array = languages.getExpressionLanguageArray();
        assert array != null;

        for(int i = 0; i < array.length; i++) {
            String name = array[i].getName();
            String className = array[i].getFactoryClass();

            ExpressionEngineFactory factory = null;
            try {
                Class type = Class.forName(className);
                factory = (ExpressionEngineFactory)type.newInstance();
            } catch(ClassNotFoundException cnf) {
                if(_logger.isWarnEnabled())
                    _logger.warn("Could not create an ExpressionEngineFactory for type \"" + className +
                        "\" because the implementation class could not be found.");

                continue;
            } catch(Exception ex) {
                assert ex instanceof IllegalAccessException || ex instanceof InstantiationException;

                if(_logger.isWarnEnabled())
                    _logger.warn("Could not create an ExpressionEngineFactory for type \"" + className +
                        "\" because an error occurred creating the factory.  Cause: " + ex, ex);
                continue;
            }

            if(factoryMap.containsKey(name))
                if(_logger.isWarnEnabled())
                    _logger.warn("Overwriting a previously defined ExpressionEngineFactory named \"" + name +
                        "\" with a new ExpressionEngineFactory of type \"" + className + "\"");
                else
                    _logger.info("Adding an ExpressionEngineFactory named \"" + name + "\" with implementation \"" + className + "\"");

            factoryMap.put(name, factory);
        }

        ExpressionEngineFactory defaultEngineFactory = null;
        String defaultLanguage = languages.getDefaultLanguage();
        if(defaultLanguage != null) {
            defaultEngineFactory = (ExpressionEngineFactory)factoryMap.get(defaultLanguage);
            if(defaultEngineFactory != null) {
                if(_logger.isInfoEnabled())
                    _logger.info("Using a default expression evaluator of type \"" + factoryMap.get(defaultLanguage).getClass().getName() + "\"");
View Full Code Here

TOP

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

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.