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
27 final class LiteralAttributeInstruction implements Instruction
28 {
29 private final String attr;
30
31 private final String text;
32
33 public LiteralAttributeInstruction(String attr, String text)
34 {
35 this.attr = attr;
36 this.text = text;
37 }
38
39 public void write(FacesContext context) throws IOException
40 {
41 context.getResponseWriter().writeAttribute(this.attr, this.text, null);
42 }
43
44 public Instruction apply(ExpressionFactory factory, ELContext ctx)
45 {
46 return this;
47 }
48
49 public boolean isLiteral()
50 {
51 return true;
52 }
53 }