Package org.apache.myfaces.view.facelets.util

Examples of org.apache.myfaces.view.facelets.util.FastWriter


        return this.txt.toString();
    }

    public String getText(FaceletContext ctx)
    {
        Writer writer = new FastWriter(this.length);
        try
        {
            this.txt.apply(ctx.getExpressionFactory(), ctx).write(writer, ctx);
        }
        catch (IOException e)
        {
            throw new ELException(this.alias + ": " + e.getMessage(), e.getCause());
        }
        return writer.toString();
    }
View Full Code Here


        return this.txt.toString();
    }

    public String getText(FaceletContext ctx)
    {
        Writer writer = new FastWriter(this.length);
        try
        {
            this.txt.apply(ctx.getExpressionFactory(), ctx).write(writer, ctx);
        }
        catch (IOException e)
        {
            throw new ELException(this.alias + ": " + e.getMessage(), e.getCause());
        }
        return writer.toString();
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private static String writeDebugOutput(FacesContext faces) throws IOException
    {
        FastWriter fw = new FastWriter();
        ErrorPageWriter.debugHtml(fw, faces);

        Map<String, Object> session = faces.getExternalContext().getSessionMap();
        Map<String, String> debugs = (Map<String, String>) session.get(KEY);
        if (debugs == null)
        {
            debugs = new LinkedHashMap<String, String>()
            {
                protected boolean removeEldestEntry(Entry<String, String> eldest)
                {
                    return (this.size() > 5);
                }
            };
           
            session.put(KEY, debugs);
        }
       
        String id = String.valueOf(nextId++);
       
        debugs.put(id, fw.toString());
       
        return id;
    }
View Full Code Here

    {
        if (!this.writtenState)
        {
            this.writtenState = true;
            this.writtenStateWithoutWrapper = false;
            this.fast = new FastWriter(this.initialSize);
            this.out = this.fast;
        }
    }
View Full Code Here

        return this.txt.toString();
    }

    public String getText(FaceletContext ctx)
    {
        Writer writer = new FastWriter(this.length);
        try
        {
            this.txt.apply(ctx.getExpressionFactory(), ctx).write(writer, ctx);
        }
        catch (IOException e)
        {
            throw new ELException(this.alias + ": " + e.getMessage(), e.getCause());
        }
        return writer.toString();
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private static String writeDebugOutput(FacesContext faces) throws IOException
    {
        FastWriter fw = new FastWriter();
        ErrorPageWriter.debugHtml(fw, faces);

        Map<String, Object> session = faces.getExternalContext().getSessionMap();
        Map<String, String> debugs = (Map<String, String>) session.get(KEY);
        if (debugs == null)
        {
            debugs = new LinkedHashMap<String, String>()
            {
                protected boolean removeEldestEntry(Entry<String, String> eldest)
                {
                    return (this.size() > 5);
                }
            };
           
            session.put(KEY, debugs);
        }
       
        String id = String.valueOf(nextId++);
       
        debugs.put(id, fw.toString());
       
        return id;
    }
View Full Code Here

        facesContext.getExternalContext().getRequestMap().put("company", c);
       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "repeat.xml");
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
        root.encodeAll(facesContext);
        String content = fw.toString();
       
        int hrIndex = content.indexOf("<dt>HR</dt>");
        Assert.assertNotSame(-1, hrIndex);
        int rdIndex = content.indexOf("<dt>RD</dt>", hrIndex);
        Assert.assertNotSame(-1, rdIndex);
View Full Code Here

        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
        String content = fw.toString();
       
        // offset="2" size="1" should render only 1 row
        int itemIndex1 = content.indexOf("B1");
        Assert.assertEquals(-1, itemIndex1);
        int itemIndex2 = content.indexOf("B2");
View Full Code Here

        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat0");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertNotSame(-1, itemIndex1);
        int itemIndex2 = content.indexOf("B2");
        Assert.assertNotSame(-1, itemIndex2);
View Full Code Here

        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat0_7");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertNotSame(-1, itemIndex1);
        int itemIndex2 = content.indexOf("B2", itemIndex1);
        Assert.assertNotSame(-1, itemIndex2);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.view.facelets.util.FastWriter

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.