Source code: com/sun/facelets/compiler/UIInstructions.java
1 /**
2 * Licensed under the Common Development and Distribution License,
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
5 *
6 * http://www.sun.com/cddl/
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11 * implied. See the License for the specific language governing
12 * permissions and limitations under the License.
13 */
14
15 package com.sun.facelets.compiler;
16
17 import java.io.IOException;
18 import java.util.Arrays;
19 import java.util.List;
20
21 import javax.faces.context.FacesContext;
22
23 import com.sun.facelets.el.ELText;
24
25 final class UIInstructions extends UILeaf {
26
27 private final ELText txt;
28
29 private final Instruction[] instructions;
30
31 public UIInstructions(ELText txt, Instruction[] instructions) {
32 this.txt = txt;
33 this.instructions = instructions;
34 }
35
36 public void encodeBegin(FacesContext context) throws IOException {
37 int size = this.instructions.length;
38 for (int i = 0; i < size; i++) {
39 this.instructions[i].write(context);
40 }
41 }
42
43 public String toString() {
44 return (this.txt != null) ? this.txt.toString() : "UIInstructions["
45 + Arrays.asList(instructions) + "]";
46 }
47
48 }