com.sun.facelets.compiler.XMLInstruction 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;
import com.sun.facelets.el.ELAdaptor;
import com.sun.facelets.el.ELText;
public class XMLInstruction implements Instruction {
private final static char[] STOP = new char[0];
private final ELText text;
public XMLInstruction(ELText text) {
this.text = text;
}
public void write(FacesContext context) throws IOException {
ResponseWriter rw = context.getResponseWriter();
rw.writeText(STOP, 0, 0); // hack to get closing elements
this.text.write(rw, ELAdaptor.getELContext(context));
}
public Instruction apply(ExpressionFactory factory, ELContext ctx) {
return new XMLInstruction(text.apply(factory, ctx));
}
public boolean isLiteral() {
return false;
}
}