Search in sources :

Example 6 with FastStringWriter

use of com.sun.faces.io.FastStringWriter in project mojarra by eclipse-ee4j.

the class HtmlResponseWriter method closeStartIfNecessary.

/**
 * This method automatically closes a previous element (if not already closed).
 *
 * @throws IOException if an error occurs writing
 */
private void closeStartIfNecessary() throws IOException {
    if (closeStart) {
        flushAttributes();
        writer.write('>');
        closeStart = false;
        if (isScriptOrStyle() && !scriptOrStyleSrc) {
            isXhtml = getContentType().equals(RIConstants.XHTML_CONTENT_TYPE);
            if (isXhtml) {
                if (!writingCdata) {
                    if (isScript) {
                        writer.write("\n//<![CDATA[\n");
                    } else {
                        writer.write("\n<![CDATA[\n");
                    }
                }
            } else {
                if (isScriptHidingEnabled) {
                    writer.write("\n<!--\n");
                }
            }
            origWriter = writer;
            if (scriptBuffer == null) {
                scriptBuffer = new FastStringWriter(1024);
            }
            scriptBuffer.reset();
            writer = scriptBuffer;
            isScript = false;
            isStyle = false;
        }
    }
}
Also used : FastStringWriter(com.sun.faces.io.FastStringWriter)

Example 7 with FastStringWriter

use of com.sun.faces.io.FastStringWriter in project mojarra by eclipse-ee4j.

the class DebugUtil method printTree.

/**
 * @param root the root component
 * @return the output of printTree() as a String. Useful when used with a Logger. For example:
 * logger.log(DebugUtil.printTree(root));
 */
public static String printTree(UIComponent root) {
    Writer writer = new FastStringWriter(1024);
    printTree(root, writer);
    return writer.toString();
}
Also used : FastStringWriter(com.sun.faces.io.FastStringWriter) PrintWriter(java.io.PrintWriter) StringWriter(java.io.StringWriter) Writer(java.io.Writer) FastStringWriter(com.sun.faces.io.FastStringWriter)

Aggregations

FastStringWriter (com.sun.faces.io.FastStringWriter)7 WebConfiguration (com.sun.faces.config.WebConfiguration)1 MessageUtils.getExceptionMessageString (com.sun.faces.util.MessageUtils.getExceptionMessageString)1 UIComponent (jakarta.faces.component.UIComponent)1 ResponseWriter (jakarta.faces.context.ResponseWriter)1 SelectItem (jakarta.faces.model.SelectItem)1 ViewDeclarationLanguage (jakarta.faces.view.ViewDeclarationLanguage)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 Writer (java.io.Writer)1 Matcher (java.util.regex.Matcher)1