All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.facelets.compiler.LiteralXMLInstruction Maven / Gradle / Ivy

Go to download

Facelets is an open source alternative view handler technology for JavaServer Faces (JSF).

The newest version!
package com.sun.facelets.compiler;

import java.io.IOException;

import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;

final class LiteralXMLInstruction implements Instruction {

    private final static char[] STOP = new char[0];
    
    private final char[] instruction;
    private final int len;
    
    public LiteralXMLInstruction(String literal) {
        this.instruction = literal.toCharArray();
        this.len = this.instruction.length;
    }

    public void write(FacesContext context) throws IOException {
        ResponseWriter rw = context.getResponseWriter();
        rw.writeText(STOP, 0, 0); // hack to get closing elements
        rw.write(this.instruction, 0, this.len);
    }

    public Instruction apply(ExpressionFactory factory, ELContext ctx) {
        return this;
    }

    public boolean isLiteral() {
        return true;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy