1 14 15 package com.sun.facelets.compiler; 16 17 import java.io.IOException ; 18 19 import javax.el.ELException; 20 import javax.faces.component.UIComponentBase; 21 import javax.faces.context.FacesContext; 22 import javax.faces.context.ResponseWriter; 23 24 import com.sun.facelets.el.ELAdaptor; 25 import com.sun.facelets.el.ELText; 26 27 31 final class UIText extends UILeaf { 32 33 private final ELText txt; 34 35 private final String alias; 36 37 public UIText(String alias, ELText txt) { 38 this.txt = txt; 39 this.alias = alias; 40 } 41 42 public String getFamily() { 43 return null; 44 } 45 46 public void encodeBegin(FacesContext context) throws IOException { 47 ResponseWriter out = context.getResponseWriter(); 48 try { 49 txt.write(out, ELAdaptor.getELContext(context)); 50 } catch (ELException e) { 51 throw new ELException(this.alias + ": " + e.getMessage(), e.getCause()); 52 } catch (Exception e) { 53 throw new ELException(this.alias + ": " + e.getMessage(), e); 54 } 55 } 56 57 public String getRendererType() { 58 return null; 59 } 60 61 public boolean getRendersChildren() { 62 return true; 63 } 64 65 public String toString() { 66 return this.txt.toString(); 67 } 68 } 69 | Popular Tags |