public final FaceletHandler compile(URL src, String alias) throws IOException { //if (!this.initialized) // this.initialize(); return this.doCompile(src, alias); }
public final FaceletHandler metadataCompile(URL src, String alias) throws IOException { return this.doMetadataCompile(src, alias); }
decObj = (TagDecorator) ReflectionUtil.forName(decorator) .newInstance(); c.addTagDecorator(decObj); 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));
public CompilationManager(String alias, Compiler compiler) { // this is our alias this.alias = alias; // grab compiler state this.compiler = compiler; this.tagDecorator = compiler.createTagDecorator(); this.tagLibrary = compiler.createTagLibrary(this.getCompilationMessageHolder()); // namespace management this.namespaceManager = new NamespaceManager(); // tag uids this.tagId = 0; // for composition use this.finished = false; // our compilationunit stack this.units = new Stack<CompilationUnit>(); this.units.push(new CompilationUnit()); config = WebConfiguration.getInstance(); }
private DefaultFacelet createMetadataFacelet(URL url) throws IOException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Metadata Facelet for: " + url); } String escapedBaseURL = Pattern.quote(this.baseUrl.getFile()); String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, ""); try { FaceletHandler h = this.compiler.metadataCompile(url, alias); return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias, h); } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, ""); try { FaceletHandler h = this.compiler.compile(url, alias); return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias,
private void processTaglibraryClass(ServletContext servletContext, FacesContext facesContext, NodeList libraryClass, Compiler compiler) { Node n = libraryClass.item(0); String className = getNodeText(n); TagLibrary taglib = (TagLibrary) createInstance(servletContext, facesContext, className, n); compiler.addTagLibrary(taglib); }
public void writeComment(String text) { if (this.compiler.isTrimmingComments()) return; if (this.finished) { return; } // don't carelessly add empty tags if (text.length() == 0) { return; } TextUnit unit; if (this.currentUnit() instanceof TextUnit) { unit = (TextUnit) this.currentUnit(); } else { unit = new TextUnit(this.alias, this.nextTagId()); this.startUnit(unit); } unit.writeComment(text); }
public final ExpressionFactory createExpressionFactory() { ExpressionFactory el = null; el = (ExpressionFactory) this.featureInstance(EXPRESSION_FACTORY); if (el == null) { try { el = FacesContext.getCurrentInstance().getApplication() .getExpressionFactory(); if (el == null) { if (log.isLoggable(Level.WARNING)) { log.warning("No default ExpressionFactory from Faces Implementation, attempting to load from Feature[" + EXPRESSION_FACTORY + "]"); } } } catch (Exception e) { if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "Unable to get ExpressionFactory because of: ", e); } } } if (el == null) { this.features.put(EXPRESSION_FACTORY, "com.sun.el.ExpressionFactoryImpl"); el = (ExpressionFactory) this.featureInstance(EXPRESSION_FACTORY); } return el; }
protected void loadDecorators(Map<String, Object> appMap, Compiler newCompiler) { String decoratorsParamValue = webConfig.getOptionValue(FaceletsDecorators); if (decoratorsParamValue != null) { for (String decorator : split(appMap, decoratorsParamValue.trim(), ";")) { try { newCompiler.addTagDecorator((TagDecorator) forName(decorator).newInstance()); if (LOGGER.isLoggable(FINE)) { LOGGER.log(FINE, "Successfully Loaded Decorator: {0}", decorator); } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { if (LOGGER.isLoggable(SEVERE)) { LOGGER.log(SEVERE, "Error Loading Decorator: " + decorator, e); } } } } }
public CompilationManager(String alias, Compiler compiler) { // this is our alias this.alias = alias; // grab compiler state this.compiler = compiler; this.tagDecorator = compiler.createTagDecorator(); this.tagLibrary = compiler.createTagLibrary(this.getCompilationMessageHolder()); // namespace management this.namespaceManager = new NamespaceManager(); // tag uids this.tagId = 0; // for composition use this.finished = false; // our compilationunit stack this.units = new Stack<>(); this.units.push(new CompilationUnit()); config = WebConfiguration.getInstance(); }
private DefaultFacelet createMetadataFacelet(URL url) throws IOException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Metadata Facelet for: " + url); } String escapedBaseURL = Pattern.quote(this.baseUrl.getFile()); String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, ""); try { FaceletHandler h = this.compiler.metadataCompile(url, alias); return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias, h); } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, ""); try { FaceletHandler h = this.compiler.compile(url, alias); return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias,
private void processTaglibraryClass(ServletContext servletContext, FacesContext facesContext, NodeList libraryClass, Compiler compiler) { Node n = libraryClass.item(0); String className = getNodeText(n); TagLibrary taglib = (TagLibrary) createInstance(servletContext, facesContext, className, n); compiler.addTagLibrary(taglib); }
public void writeComment(String text) { if (this.compiler.isTrimmingComments()) return; if (this.finished) { return; } // don't carelessly add empty tags if (text.length() == 0) { return; } TextUnit unit; if (this.currentUnit() instanceof TextUnit) { unit = (TextUnit) this.currentUnit(); } else { unit = new TextUnit(this.alias, this.nextTagId()); this.startUnit(unit); } unit.writeComment(text); }
public final ExpressionFactory createExpressionFactory() { ExpressionFactory el = null; el = (ExpressionFactory) this.featureInstance(EXPRESSION_FACTORY); if (el == null) { try { el = FacesContext.getCurrentInstance().getApplication() .getExpressionFactory(); if (el == null) { if (log.isLoggable(Level.WARNING)) { log.warning("No default ExpressionFactory from Faces Implementation, attempting to load from Feature[" + EXPRESSION_FACTORY + "]"); } } } catch (Exception e) { if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "Unable to get ExpressionFactory because of: ", e); } } } if (el == null) { this.features.put(EXPRESSION_FACTORY, "com.sun.el.ExpressionFactoryImpl"); el = (ExpressionFactory) this.featureInstance(EXPRESSION_FACTORY); } return el; }
protected void loadDecorators(Map<String, Object> appMap, Compiler newCompiler) { String decoratorsParamValue = webConfig.getOptionValue(FaceletsDecorators); if (decoratorsParamValue != null) { for (String decorator : split(appMap, decoratorsParamValue.trim(), ";")) { try { newCompiler.addTagDecorator((TagDecorator) forName(decorator).newInstance()); if (LOGGER.isLoggable(FINE)) { LOGGER.log(FINE, "Successfully Loaded Decorator: {0}", decorator); } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { if (LOGGER.isLoggable(SEVERE)) { LOGGER.log(SEVERE, "Error Loading Decorator: " + decorator, e); } } } } }
public CompilationManager(String alias, Compiler compiler) { // this is our alias this.alias = alias; // grab compiler state this.compiler = compiler; this.tagDecorator = compiler.createTagDecorator(); this.tagLibrary = compiler.createTagLibrary(this.getCompilationMessageHolder()); // namespace management this.namespaceManager = new NamespaceManager(); // tag uids this.tagId = 0; // for composition use this.finished = false; // our compilationunit stack this.units = new Stack<>(); this.units.push(new CompilationUnit()); config = WebConfiguration.getInstance(); }
private DefaultFacelet createMetadataFacelet(URL url) throws IOException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Metadata Facelet for: " + url); } String escapedBaseURL = Pattern.quote(this.baseUrl.getFile()); String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, ""); try { FaceletHandler h = this.compiler.metadataCompile(url, alias); return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias, h); } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, ""); try { FaceletHandler h = this.compiler.compile(url, alias); return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias,