1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.view.facelets.compiler;
20
21 import java.io.IOException;
22
23 import javax.el.ELContext;
24 import javax.el.ExpressionFactory;
25 import javax.faces.context.FacesContext;
26 import javax.faces.context.ResponseWriter;
27
28 import org.apache.myfaces.view.facelets.el.ELText;
29
30 public class XMLInstruction implements Instruction
31 {
32 private final static char[] STOP = new char[0];
33
34 private final ELText _text;
35
36 public XMLInstruction(ELText text)
37 {
38 _text = text;
39 }
40
41 public void write(FacesContext context) throws IOException
42 {
43 ResponseWriter rw = context.getResponseWriter();
44 rw.writeText(STOP, 0, 0);
45 _text.write(rw, context.getELContext());
46 }
47
48 public Instruction apply(ExpressionFactory factory, ELContext ctx)
49 {
50 return new XMLInstruction(_text.apply(factory, ctx));
51 }
52
53 public boolean isLiteral()
54 {
55 return false;
56 }
57 }