Package com.sun.faces.config.beans

Examples of com.sun.faces.config.beans.ApplicationBean


            top = (ResourceBundleBean) digester.pop();
        } catch (Exception e) {
            throw new IllegalStateException("Popped object is not a " +
                                            CLASS_NAME + " instance");
        }
        ApplicationBean fcb = (ApplicationBean) digester.peek();
        if (null != fcb.getResourceBundle(top.getVar())) {
            throw new IllegalStateException("Multiple ResourceBundle definitions " +
                    "with the same name: " + top.getVar() + ".");
        }
        fcb.addResourceBundle(top);

    }


            fcb = (FacesConfigBean) digester.peek();
        } catch (Exception e) {
            throw new IllegalStateException
                ("No parent FacesConfigBean on object stack");
        }
        ApplicationBean ab = fcb.getApplication();
        if (ab == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[ApplicationRule]{" +
                                           digester.getMatch() +
                                           "} New " + CLASS_NAME);

     */
    public void begin(String namespace, String name,
                      Attributes attributes) throws Exception {

       
        ApplicationBean ab = null;
        try {
            ab = (ApplicationBean) digester.peek();
        } catch (Exception e) {
            throw new IllegalStateException
                ("No parent ApplicationBean on object stack");
        }
        LocaleConfigBean lcb = ab.getLocaleConfig();
        if (lcb == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[LocaleConfigRule]{" +
                                           digester.getMatch() +
                                           "} New " + CLASS_NAME);
            }
            Class clazz =
                digester.getClassLoader().loadClass(CLASS_NAME);
            lcb = (LocaleConfigBean) clazz.newInstance();
            ab.setLocaleConfig(lcb);
        } else {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[LocaleConfigRule]{" +
                                           digester.getMatch() +
                                           "} Old " + CLASS_NAME);

        factoryBean.addApplicationFactory("com.sun.faces.application.ApplicationFactoryImpl");
        factoryBean.addFacesContextFactory("com.sun.faces.context.FacesContextFactoryImpl");
        factoryBean.addLifecycleFactory("com.sun.faces.lifecycle.LifecycleFactoryImpl");
        factoryBean.addRenderKitFactory("com.sun.faces.renderkit.RenderKitFactoryImpl");

        applicationBean = new ApplicationBean();
        applicationBean.addActionListener("com.sun.faces.application.ActionListenerImpl");
        applicationBean.addNavigationHandler("com.sun.faces.application.NavigationHandlerImpl");
        applicationBean.addStateManager("com.sun.faces.application.StateManagerImpl");
        applicationBean.addViewHandler("com.sun.faces.application.ViewHandlerImpl");

            top = (ResourceBundleBean) digester.pop();
        } catch (Exception e) {
            throw new IllegalStateException("Popped object is not a " +
                                            CLASS_NAME + " instance");
        }
        ApplicationBean fcb = (ApplicationBean) digester.peek();
        if (null != fcb.getResourceBundle(top.getVar())) {
            throw new IllegalStateException("Multiple ResourceBundle definitions " +
                    "with the same name: " + top.getVar() + ".");
        }
        fcb.addResourceBundle(top);

    }

            fcb = (FacesConfigBean) digester.peek();
        } catch (Exception e) {
            throw new IllegalStateException
                ("No parent FacesConfigBean on object stack");
        }
        ApplicationBean ab = fcb.getApplication();
        if (ab == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[ApplicationRule]{" +
                                           digester.getMatch() +
                                           "} New " + CLASS_NAME);

     */
    public void begin(String namespace, String name,
                      Attributes attributes) throws Exception {

       
        ApplicationBean ab = null;
        try {
            ab = (ApplicationBean) digester.peek();
        } catch (Exception e) {
            throw new IllegalStateException
                ("No parent ApplicationBean on object stack");
        }
        LocaleConfigBean lcb = ab.getLocaleConfig();
        if (lcb == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[LocaleConfigRule]{" +
                                           digester.getMatch() +
                                           "} New " + CLASS_NAME);
            }
            Class clazz =
                digester.getClassLoader().loadClass(CLASS_NAME);
            lcb = (LocaleConfigBean) clazz.newInstance();
            ab.setLocaleConfig(lcb);
        } else {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[LocaleConfigRule]{" +
                                           digester.getMatch() +
                                           "} Old " + CLASS_NAME);

TOP

Related Classes of com.sun.faces.config.beans.ApplicationBean

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.