com.sun.facelets.compiler.LiteralXMLInstruction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsf-facelets Show documentation
Show all versions of jsf-facelets Show documentation
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;
}
}