Package com.sun.faces.facelets.compiler

Examples of com.sun.faces.facelets.compiler.Compiler


    }


    protected Compiler createCompiler(Map<String, Object> appMap, WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(appMap, decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new CoreLibrary("http://xmlns.jcp.org/jsf/core"));
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new HtmlLibrary("http://xmlns.jcp.org/jsf/html"));
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new UILibrary("http://xmlns.jcp.org/jsf/facelets"));
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new JstlCoreLibrary("http://java.sun.com/jstl/core"));
        c.addTagLibrary(new JstlCoreLibrary("http://xmlns.jcp.org/jsp/jstl/core"));
        c.addTagLibrary(new PassThroughAttributeLibrary());
        c.addTagLibrary(new PassThroughElementLibrary());
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://xmlns.jcp.org/jsp/jstl/functions"));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions"));
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://xmlns.jcp.org/mojarra/private/functions"));
        }
        c.addTagLibrary(new CompositeLibrary());
        c.addTagLibrary(new CompositeLibrary("http://xmlns.jcp.org/jsf/composite"));

        return c;

    }
View Full Code Here


    }


    protected Compiler createCompiler(Map<String, Object> appMap, WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(appMap, decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new CoreLibrary(CoreLibrary.XMLNSNamespace));
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new HtmlLibrary(HtmlLibrary.XMLNSNamespace));
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new UILibrary(UILibrary.XMLNSNamespace));
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new JstlCoreLibrary(JstlCoreLibrary.IncorrectNamespace));
        c.addTagLibrary(new JstlCoreLibrary(JstlCoreLibrary.XMLNSNamespace));
        c.addTagLibrary(new PassThroughAttributeLibrary());
        c.addTagLibrary(new PassThroughElementLibrary());
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, FunctionLibrary.Namespace));
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, FunctionLibrary.XMLNSNamespace));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, DevTools.Namespace));
            c.addTagLibrary(new FunctionLibrary(DevTools.class, DevTools.NewNamespace));
        }
        c.addTagLibrary(new CompositeLibrary());
        c.addTagLibrary(new CompositeLibrary(CompositeLibrary.XMLNSNamespace));

        return c;

    }
View Full Code Here

    }


    protected Compiler createCompiler(Map<String, Object> appMap, WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(appMap, decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new JstlCoreLibrary("http://java.sun.com/jstl/core"));
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions"));
        }
        c.addTagLibrary(new CompositeLibrary());

        return c;

    }
View Full Code Here

    throws Exception {

        ApplicationAssociate associate =
              ApplicationAssociate.getInstance(FacesContext.getCurrentInstance().getExternalContext());
        assert (associate != null);
        Compiler compiler = associate.getCompiler();

        for (int i = 0, length = documentInfos.length; i < length; i++) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           MessageFormat.format(
View Full Code Here

    throws Exception {

        ApplicationAssociate associate =
              ApplicationAssociate.getInstance(FacesContext.getCurrentInstance().getExternalContext());
        assert (associate != null);
        Compiler compiler = associate.getCompiler();

        for (int i = 0, length = documentInfos.length; i < length; i++) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           MessageFormat.format(
View Full Code Here

    }


    protected Compiler createCompiler(WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions"));
        }
        c.addTagLibrary(new CompositeLibrary());

        return c;

    }
View Full Code Here

    }


    protected Compiler createCompiler(Map<String, Object> appMap, WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(appMap, decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new JstlCoreLibrary("http://java.sun.com/jstl/core"));
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions"));
        }
        c.addTagLibrary(new CompositeLibrary());

        return c;

    }
View Full Code Here

    throws Exception {

        ApplicationAssociate associate =
              ApplicationAssociate.getInstance(FacesContext.getCurrentInstance().getExternalContext());
        assert (associate != null);
        Compiler compiler = associate.getCompiler();

        for (int i = 0, length = documents.length; i < length; i++) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           MessageFormat.format(
View Full Code Here

    }


    protected Compiler createCompiler(WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions"));
        }
        c.addTagLibrary(new CompositeLibrary());

        return c;

    }
View Full Code Here

    }


    protected Compiler createCompiler(WebConfiguration webConfig) {

        Compiler c = new SAXCompiler();

        // load decorators
        String decParam = webConfig
              .getOptionValue(FaceletsDecorators);
        if (decParam != null) {
            decParam = decParam.trim();
            String[] decs = Util.split(decParam, ";");
            TagDecorator decObj;
            for (String decorator : decs) {
                try {
                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
                          .newInstance();
                    c.addTagDecorator(decObj);

                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Successfully Loaded Decorator: {0}",
                                   decorator);
                    }
                } catch (Exception e) {
                    if (LOGGER.isLoggable(Level.SEVERE)) {
                        LOGGER.log(Level.SEVERE,
                                   "Error Loading Decorator: " + decorator,
                                   e);
                    }
                }
            }
        }

        // skip params?
        c.setTrimmingComments(
              webConfig.isOptionEnabled(
                    BooleanWebContextInitParameter.FaceletsSkipComments));

        c.addTagLibrary(new CoreLibrary());
        c.addTagLibrary(new HtmlLibrary());
        c.addTagLibrary(new UILibrary());
        c.addTagLibrary(new JstlCoreLibrary());
        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
        if (isDevModeEnabled()) {
            c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions"));
        }
        c.addTagLibrary(new CompositeLibrary());

        return c;

    }
View Full Code Here

TOP

Related Classes of com.sun.faces.facelets.compiler.Compiler

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.