1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.fatwire.gst.foundation.include;
17
18 import java.util.Date;
19
20 import COM.FutureTense.Interfaces.ICS;
21
22 import com.fatwire.gst.foundation.facade.runtag.render.CallElement;
23 import com.fatwire.gst.foundation.facade.runtag.render.CallElement.Scope;
24
25
26
27
28
29
30
31 public class IncludeElement implements Include {
32
33 private final CallElement tag;
34 private final ICS ics;
35
36
37
38
39
40 public IncludeElement(final ICS ics, final String elementname) {
41 tag = new CallElement(elementname);
42 this.ics = ics;
43
44 }
45
46
47
48
49
50
51
52
53 public void include(final ICS ics) {
54 final String s = tag.execute(ics);
55 if (s != null) {
56 ics.StreamText(s);
57 }
58 }
59
60
61
62
63
64
65
66
67 public IncludeElement argument(final String name, final String value) {
68 tag.setArgument(name, value);
69 return this;
70 }
71
72
73
74
75
76
77
78
79 public IncludeElement argument(final String name, final Date value) {
80 tag.set(name, value);
81 return this;
82 }
83
84
85
86
87
88
89
90
91 public IncludeElement argument(final String name, final long value) {
92 tag.set(name, value);
93 return this;
94 }
95
96
97
98
99
100
101
102
103 public IncludeElement argument(final String name, final int value) {
104 tag.set(name, value);
105 return this;
106 }
107
108
109
110
111
112
113
114
115 public IncludeElement argument(final String name, final boolean value) {
116 tag.set(name, value);
117 return this;
118 }
119
120
121
122
123
124
125
126
127 public IncludeElement argument(final String name, final byte[] value) {
128 tag.set(name, value);
129 return this;
130 }
131
132
133
134
135
136
137
138 public IncludeElement copyArguments(final String... name) {
139 if (name == null) {
140 return this;
141 }
142 for (final String n : name) {
143 argument(n, ics.GetVar(n));
144 }
145 return this;
146 }
147
148
149
150
151
152 public IncludeElement setScope(final Scope scope) {
153 tag.setScope(scope);
154 return this;
155 }
156
157 public IncludeElement global() {
158 tag.setScope(Scope.GLOBAL);
159 return this;
160 }
161
162 public IncludeElement stacked() {
163 tag.setScope(Scope.STACKED);
164 return this;
165 }
166
167 public IncludeElement local() {
168 tag.setScope(Scope.LOCAL);
169 return this;
170 }
171
172 }