empire-db-jakarta-faces/src/main/java/org/apache/empire/jakarta/utils/StringResponseWriter.java [31:148]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class StringResponseWriter extends ResponseWriter
{
    private StringBuilder buf = new StringBuilder();

    @Override
    public String getContentType()
    {
        return "text/html";
    }

    @Override
    public String getCharacterEncoding()
    {
        return "UTF-8";
    }

    @Override
    public void flush()
        throws IOException
    {
    }

    @Override
    public void startDocument()
        throws IOException
    {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void endDocument()
        throws IOException
    {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void startElement(String name, UIComponent component)
        throws IOException
    {
        buf.append("<");
        buf.append(name);
        buf.append(">");
    }

    @Override
    public void endElement(String name)
        throws IOException
    {
        buf.append("</");
        buf.append(name);
        buf.append(">");
    }

    @Override
    public void writeAttribute(String name, Object value, String property)
        throws IOException
    {
        if (StringUtils.isEmpty(name) || ObjectUtils.isEmpty(value))
            return;
        buf.append(name);
        buf.append("=");
        buf.append(String.valueOf(value));
    }

    @Override
    public void writeURIAttribute(String name, Object value, String property)
        throws IOException
    {
        writeAttribute(name, value, property);
    }

    @Override
    public void writeComment(Object comment)
        throws IOException
    {
        /* Nothing */
    }

    @Override
    public void writeText(Object text, String property)
        throws IOException
    {
        buf.append(text);
    }

    @Override
    public void writeText(char[] text, int off, int len)
        throws IOException
    {
        buf.append(text, off, len);
    }

    @Override
    public ResponseWriter cloneWithWriter(Writer writer)
    {
        throw new NotImplementedException(getClass(), "cloneWithWriter");
    }

    @Override
    public void write(char[] cbuf, int off, int len)
        throws IOException
    {
        buf.append(cbuf, off, len);
    }

    @Override
    public void close()
        throws IOException
    {
    }

    @Override
    public String toString()
    {
        return buf.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/StringResponseWriter.java [31:148]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class StringResponseWriter extends ResponseWriter
{
    private StringBuilder buf = new StringBuilder();

    @Override
    public String getContentType()
    {
        return "text/html";
    }

    @Override
    public String getCharacterEncoding()
    {
        return "UTF-8";
    }

    @Override
    public void flush()
        throws IOException
    {
    }

    @Override
    public void startDocument()
        throws IOException
    {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void endDocument()
        throws IOException
    {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void startElement(String name, UIComponent component)
        throws IOException
    {
        buf.append("<");
        buf.append(name);
        buf.append(">");
    }

    @Override
    public void endElement(String name)
        throws IOException
    {
        buf.append("</");
        buf.append(name);
        buf.append(">");
    }

    @Override
    public void writeAttribute(String name, Object value, String property)
        throws IOException
    {
        if (StringUtils.isEmpty(name) || ObjectUtils.isEmpty(value))
            return;
        buf.append(name);
        buf.append("=");
        buf.append(String.valueOf(value));
    }

    @Override
    public void writeURIAttribute(String name, Object value, String property)
        throws IOException
    {
        writeAttribute(name, value, property);
    }

    @Override
    public void writeComment(Object comment)
        throws IOException
    {
        /* Nothing */
    }

    @Override
    public void writeText(Object text, String property)
        throws IOException
    {
        buf.append(text);
    }

    @Override
    public void writeText(char[] text, int off, int len)
        throws IOException
    {
        buf.append(text, off, len);
    }

    @Override
    public ResponseWriter cloneWithWriter(Writer writer)
    {
        throw new NotImplementedException(getClass(), "cloneWithWriter");
    }

    @Override
    public void write(char[] cbuf, int off, int len)
        throws IOException
    {
        buf.append(cbuf, off, len);
    }

    @Override
    public void close()
        throws IOException
    {
    }

    @Override
    public String toString()
    {
        return buf.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



