Search in sources :

Example 1 with Compiler

use of com.sun.faces.facelets.compiler.Compiler in project mojarra by eclipse-ee4j.

the class FaceletTaglibConfigProcessor method process.

// -------------------------------------------- Methods from ConfigProcessor
@Override
public void process(ServletContext sc, FacesContext facesContext, DocumentInfo[] documentInfos) throws Exception {
    ApplicationAssociate associate = ApplicationAssociate.getInstance(facesContext.getExternalContext());
    Compiler compiler = associate.getCompiler();
    for (int i = 0, length = documentInfos.length; i < length; i++) {
        if (LOGGER.isLoggable(FINE)) {
            LOGGER.log(FINE, format("Processing facelet-taglibrary document: ''{0}''", documentInfos[i].getSourceURI()));
        }
        Document document = documentInfos[i].getDocument();
        String namespace = document.getDocumentElement().getNamespaceURI();
        Element documentElement = document.getDocumentElement();
        NodeList libraryClass = documentElement.getElementsByTagNameNS(namespace, LIBRARY_CLASS);
        if (libraryClass != null && libraryClass.getLength() > 0) {
            processTaglibraryClass(sc, facesContext, libraryClass, compiler);
        } else {
            processTagLibrary(sc, facesContext, documentElement, namespace, compiler);
        }
    }
}
Also used : Compiler(com.sun.faces.facelets.compiler.Compiler) ApplicationAssociate(com.sun.faces.application.ApplicationAssociate) Element(org.w3c.dom.Element) NodeList(org.w3c.dom.NodeList) Document(org.w3c.dom.Document)

Example 2 with Compiler

use of com.sun.faces.facelets.compiler.Compiler in project mojarra by eclipse-ee4j.

the class ApplicationAssociate method createCompiler.

protected Compiler createCompiler(Map<String, Object> appMap, WebConfiguration webConfig) {
    Compiler newCompiler = new SAXCompiler();
    loadDecorators(appMap, newCompiler);
    // Skip params?
    newCompiler.setTrimmingComments(webConfig.isOptionEnabled(FaceletsSkipComments));
    addTagLibraries(newCompiler);
    return newCompiler;
}
Also used : SAXCompiler(com.sun.faces.facelets.compiler.SAXCompiler) Compiler(com.sun.faces.facelets.compiler.Compiler) SAXCompiler(com.sun.faces.facelets.compiler.SAXCompiler)

Aggregations

Compiler (com.sun.faces.facelets.compiler.Compiler)2 ApplicationAssociate (com.sun.faces.application.ApplicationAssociate)1 SAXCompiler (com.sun.faces.facelets.compiler.SAXCompiler)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1 NodeList (org.w3c.dom.NodeList)1