Examples of FastWriter


Examples of org.apache.myfaces.shared_tomahawk.util.FastWriter

    throws FacesException
    {
        _outputWriter = writer;
        //The current writer to be used is the one used as output
        _currentWriter = _outputWriter;
        _bufferedWriter = new FastWriter(1024);
        _wrapScriptContentWithXmlCommentTag = wrapScriptContentWithXmlCommentTag;
       
        _contentType = contentType;
        if (_contentType == null)
        {
View Full Code Here

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

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

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

    }

    @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

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

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

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

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

    }

    @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

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

        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

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

        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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.