public Facelet compileComponentFacelet(String taglibURI, String tagName, Map<String,Object> attributes) { FaceletHandler handler = _compiler.compileComponent(taglibURI, tagName, attributes); String alias = "/component/oamf:"+tagName; return new DefaultFacelet(this, _compiler.createExpressionFactory(), getBaseUrl(), alias, alias, handler); }
public final FaceletHandler compile(URL src, String alias) throws IOException, FaceletException, ELException, FacesException { if (!this.initialized) this.initialize(); return this.doCompile(src, alias); }
public final FaceletHandler compileCompositeComponentMetadata(URL src, String alias) throws IOException, FaceletException, ELException, FacesException { if (!this.initialized) this.initialize(); return this.doCompileCompositeComponentMetadata(src, alias); }
c.addTagLibrary(libObj); log.fine("Successfully Loaded Library: " + libs[i]); c.addTagDecorator(decObj); log.fine("Successfully Loaded Decorator: " + decs[i]); if (skipParam != null && "true".equals(skipParam)) c.setTrimmingComments(true);
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(); // 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()); this.interfaceCompilationUnit = null; }
/** * Uses the internal Compiler reference to build a Facelet given the passed URL. * * @param url * source * @return a Facelet instance * @throws IOException * @throws FaceletException * @throws FacesException * @throws ELException */ private DefaultFacelet _createFacelet(URL url) throws IOException, FaceletException, FacesException, ELException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Facelet for: " + url); } String alias = "/" + _removeFirst(url.getFile(), _baseUrl.getFile()); try { FaceletHandler h = _compiler.compile(url, alias); DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h); return f; } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
/** * @since 2.0 * @param url * @return * @throws IOException * @throws FaceletException * @throws FacesException * @throws ELException */ private DefaultFacelet _createViewMetadataFacelet(URL url) throws IOException, FaceletException, FacesException, ELException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Facelet used to create View Metadata for: " + url); } // The alias is used later for informative purposes, so we append // some prefix to identify later where the errors comes from. String alias = "/viewMetadata/" + _removeFirst(url.getFile(), _baseUrl.getFile()); try { FaceletHandler h = _compiler.compileViewMetadata(url, alias); DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h); return f; } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
/** * @since 2.0.1 * @param url * @return * @throws IOException * @throws FaceletException * @throws FacesException * @throws ELException */ private DefaultFacelet _createCompositeComponentMetadataFacelet(URL url) throws IOException, FaceletException, FacesException, ELException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Facelet used to create Composite Component Metadata for: " + url); } // The alias is used later for informative purposes, so we append // some prefix to identify later where the errors comes from. String alias = "/compositeComponentMetadata/" + _removeFirst(url.getFile(), _baseUrl.getFile()); try { FaceletHandler h = _compiler.compileCompositeComponentMetadata(url, alias); DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h, true); return f; } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
compiler.addTagLibrary(new CoreLibrary()); compiler.addTagLibrary(new HtmlLibrary()); compiler.addTagLibrary(new UILibrary()); compiler.addTagLibrary(new JstlCoreLibrary()); compiler.addTagLibrary(new JstlFnLibrary()); compiler.addTagLibrary(new CompositeLibrary()); compiler.addTagLibrary(new CompositeResourceLibrary()); if (tl != null) compiler.addTagLibrary(tl);
compiler.addTagDecorator((TagDecorator) ReflectionUtil.forName(decorator).newInstance()); if (log.isLoggable(Level.FINE))
private synchronized void initialize() { if (this.initialized) return; log.fine("Initializing"); try { TagLibraryConfig cfg = new TagLibraryConfig(); cfg.loadImplicit(this); if (!this.createTagLibrary().containsNamespace(UILibrary.Namespace)) { log .severe("Missing Built-in Tag Libraries! Make sure they are included within the META-INF directory of Facelets' Jar"); } } catch (IOException e) { log.log(Level.SEVERE, "Compiler Initialization Error", e); } finally { this.initialized = true; } log.fine("Initialization Successful"); }
public final FaceletHandler compileCompositeComponentMetadata(URL src, String alias) throws IOException, FaceletException, ELException, FacesException { return this.doCompileCompositeComponentMetadata(src, alias); }
public final FaceletHandler compile(URL src, String alias) throws IOException, FaceletException, ELException, FacesException { return this.doCompile(src, alias); }
c.addTagLibrary(libObj); log.fine("Successfully Loaded Library: " + libs[i]); c.addTagDecorator(decObj); log.fine("Successfully Loaded Decorator: " + decs[i]); if (skipParam != null && "true".equals(skipParam)) c.setTrimmingComments(true);
public CompilationManager(String alias, Compiler compiler, FaceletsProcessingInstructions instructions) { // this is our alias this.alias = alias; // grab compiler state this.compiler = compiler; this.tagDecorator = compiler.createTagDecorator(); this.tagLibrary = compiler.createTagLibrary(); // 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()); this.interfaceCompilationUnit = null; this.faceletsProcessingInstructions = instructions; }
/** * Uses the internal Compiler reference to build a Facelet given the passed URL. * * @param url * source * @return a Facelet instance * @throws IOException * @throws FaceletException * @throws FacesException * @throws ELException */ private DefaultFacelet _createFacelet(URL url) throws IOException, FaceletException, FacesException, ELException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Facelet for: " + url); } String alias = "/" + _removeFirst(url.getFile(), _baseUrl.getFile()); try { FaceletHandler h = _compiler.compile(url, alias); DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h); return f; } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
/** * @since 2.0 * @param url * @return * @throws IOException * @throws FaceletException * @throws FacesException * @throws ELException */ private DefaultFacelet _createViewMetadataFacelet(URL url) throws IOException, FaceletException, FacesException, ELException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Facelet used to create View Metadata for: " + url); } // The alias is used later for informative purposes, so we append // some prefix to identify later where the errors comes from. String alias = "/viewMetadata/" + _removeFirst(url.getFile(), _baseUrl.getFile()); try { FaceletHandler h = _compiler.compileViewMetadata(url, alias); DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h); return f; } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
/** * @since 2.0.1 * @param url * @return * @throws IOException * @throws FaceletException * @throws FacesException * @throws ELException */ private DefaultFacelet _createCompositeComponentMetadataFacelet(URL url) throws IOException, FaceletException, FacesException, ELException { if (log.isLoggable(Level.FINE)) { log.fine("Creating Facelet used to create Composite Component Metadata for: " + url); } // The alias is used later for informative purposes, so we append // some prefix to identify later where the errors comes from. String alias = "/compositeComponentMetadata/" + _removeFirst(url.getFile(), _baseUrl.getFile()); try { FaceletHandler h = _compiler.compileCompositeComponentMetadata(url, alias); DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h, true); return f; } catch (FileNotFoundException fnfe) { throw new FileNotFoundException("Facelet " + alias + " not found at: " + url.toExternalForm()); } }
compiler.addTagLibrary(new CoreLibrary()); compiler.addTagLibrary(new HtmlLibrary()); compiler.addTagLibrary(new UILibrary()); compiler.addTagLibrary(new JstlCoreLibrary()); compiler.addTagLibrary(new JstlFnLibrary()); compiler.addTagLibrary(new CompositeLibrary()); compiler.addTagLibrary(new CompositeResourceLibrary()); if (tl != null) compiler.addTagLibrary(tl);
/** * Load the various decorators for Facelets. * * @param context * the current FacesContext * @param compiler * the page compiler */ protected void loadDecorators(FacesContext context, Compiler compiler) { String param = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(), PARAMS_DECORATORS); if (param != null) { for (String decorator : param.split(";")) { try { compiler.addTagDecorator((TagDecorator) ReflectionUtil.forName(decorator).newInstance()); if (log.isLoggable(Level.FINE)) { log.fine("Successfully loaded decorator: " + decorator); } } catch (Exception e) { log.log(Level.SEVERE, "Error Loading decorator: " + decorator, e); } } } }