1 14 15 package com.sun.facelets.compiler; 16 17 import java.io.IOException ; 18 import java.util.List ; 19 20 import javax.el.ELContext; 21 import javax.el.ExpressionFactory; 22 23 import javax.faces.context.FacesContext; 24 import javax.faces.context.ResponseWriter; 25 26 import com.sun.facelets.el.ELAdaptor; 27 import com.sun.facelets.el.ELText; 28 29 final class CommentInstruction implements Instruction { 30 private final ELText text; 31 32 public CommentInstruction(ELText text) { 33 this.text = text; 34 } 35 36 public void write(FacesContext context) throws IOException { 37 ELContext elContext = ELAdaptor.getELContext(context); 38 context.getResponseWriter().writeComment(this.text.toString(elContext)); 39 } 40 41 public Instruction apply(ExpressionFactory factory, ELContext ctx) { 42 ELText t = this.text.apply(factory, ctx); 43 return new CommentInstruction(t); 44 } 45 46 public boolean isLiteral() { 47 return false; 48 } 49 } 50 | Popular Tags |