kwartz 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +36 -1
- data/LGPL +504 -0
- data/README.txt +16 -2
- data/bin/kwartz +1 -1
- data/doc-api/classes/Kwartz.html +47 -1
- data/doc-api/classes/Kwartz/Assertion.html +6 -6
- data/doc-api/classes/Kwartz/AssertionError.html +6 -6
- data/doc-api/classes/Kwartz/AttrInfo.html +42 -42
- data/doc-api/classes/Kwartz/BaseError.html +12 -12
- data/doc-api/classes/Kwartz/BaseTranslator.html +210 -43
- data/doc-api/classes/Kwartz/CharacterType.html +24 -24
- data/doc-api/classes/Kwartz/CommandOptionError.html +7 -7
- data/doc-api/classes/Kwartz/CommandOptions.html +49 -49
- data/doc-api/classes/Kwartz/Config.html +6 -1
- data/doc-api/classes/Kwartz/ConvertError.html +14 -14
- data/doc-api/classes/Kwartz/Converter.html +31 -30
- data/doc-api/classes/Kwartz/CssStyleParser.html +79 -57
- data/doc-api/classes/Kwartz/Defun.html +313 -0
- data/doc-api/classes/Kwartz/DocumentRuleset.html +58 -58
- data/doc-api/classes/Kwartz/ElementExpander.html +32 -32
- data/doc-api/classes/Kwartz/ElementInfo.html +29 -29
- data/doc-api/classes/Kwartz/ElementRuleset.html +126 -96
- data/doc-api/classes/Kwartz/EperlHandler.html +108 -84
- data/doc-api/classes/Kwartz/EperlTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ErubisHandler.html +2 -2
- data/doc-api/classes/Kwartz/ErubisTranslator.html +8 -8
- data/doc-api/classes/Kwartz/ErubyHandler.html +2 -220
- data/doc-api/classes/Kwartz/ErubyTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
- data/doc-api/classes/Kwartz/Handler.html +122 -117
- data/doc-api/classes/Kwartz/HandlerArgument.html +215 -0
- data/doc-api/classes/Kwartz/Helper.html +112 -0
- data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +221 -0
- data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +630 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +208 -193
- data/doc-api/classes/Kwartz/JstlTranslator.html +15 -15
- data/doc-api/classes/Kwartz/KwartzError.html +6 -6
- data/doc-api/classes/Kwartz/Main.html +39 -23
- data/doc-api/classes/Kwartz/NativeExpression.html +18 -18
- data/doc-api/classes/Kwartz/NativeStatement.html +25 -25
- data/doc-api/classes/Kwartz/Node.html +6 -6
- data/doc-api/classes/Kwartz/PIErubisHandler.html +113 -0
- data/doc-api/classes/Kwartz/PIErubisTranslator.html +200 -0
- data/doc-api/classes/Kwartz/ParseError.html +6 -6
- data/doc-api/classes/Kwartz/PhpHandler.html +102 -83
- data/doc-api/classes/Kwartz/PhpTranslator.html +14 -14
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +136 -128
- data/doc-api/classes/Kwartz/PrintStatement.html +19 -19
- data/doc-api/classes/Kwartz/RailsHandler.html +121 -118
- data/doc-api/classes/Kwartz/RailsTranslator.html +7 -7
- data/doc-api/classes/Kwartz/RubyHandler.html +349 -0
- data/doc-api/classes/Kwartz/RubyStyleParser.html +85 -85
- data/doc-api/classes/Kwartz/RubyTranslator.html +218 -0
- data/doc-api/classes/Kwartz/StatementHelper.html +479 -0
- data/doc-api/classes/Kwartz/StrutsTranslator.html +12 -12
- data/doc-api/classes/Kwartz/TagInfo.html +28 -28
- data/doc-api/classes/Kwartz/TextConverter.html +28 -28
- data/doc-api/classes/Kwartz/Translator.html +42 -42
- data/doc-api/classes/Kwartz/Util.html +284 -0
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +30 -3
- data/doc-api/files/kwartz/assert_rb.html +1 -1
- data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/erubis_rb.html +3 -3
- data/doc-api/files/kwartz/binding/eruby_rb.html +3 -2
- data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/php_rb.html +2 -2
- data/doc-api/files/kwartz/binding/pierubis_rb.html +116 -0
- data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
- data/doc-api/files/kwartz/binding/ruby_rb.html +115 -0
- data/doc-api/files/kwartz/binding/struts_rb.html +1 -1
- data/doc-api/files/kwartz/config_rb.html +2 -2
- data/doc-api/files/kwartz/converter_rb.html +3 -2
- data/doc-api/files/kwartz/defun_rb.html +116 -0
- data/doc-api/files/kwartz/error_rb.html +1 -1
- data/doc-api/files/kwartz/helper/rails_rb.html +123 -0
- data/doc-api/files/kwartz/main_rb.html +5 -2
- data/doc-api/files/kwartz/node_rb.html +2 -2
- data/doc-api/files/kwartz/parser_rb.html +2 -2
- data/doc-api/files/kwartz/translator_rb.html +2 -2
- data/doc-api/files/kwartz/util/assert-text-equal_rb.html +1 -1
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
- data/doc-api/files/kwartz/util_rb.html +107 -0
- data/doc-api/files/kwartz_rb.html +3 -2
- data/doc-api/fr_class_index.html +11 -0
- data/doc-api/fr_file_index.html +5 -0
- data/doc-api/fr_method_index.html +242 -190
- data/doc/p-pattern.html +94 -94
- data/doc/reference.html +847 -612
- data/doc/users-guide.html +744 -241
- data/examples/rails1/README +2 -2
- data/examples/rails1/application_helper.rb +2 -27
- data/examples/rails1/link_to.plogic +5 -5
- data/examples/rails1/list.plogic +2 -2
- data/examples/rails2/app/controllers/application.rb +14 -0
- data/examples/rails2/app/controllers/groups_controller.rb +47 -0
- data/examples/rails2/app/controllers/members_controller.rb +56 -0
- data/examples/rails2/app/helpers/application_helper.rb +6 -0
- data/examples/rails2/app/helpers/groups_helper.rb +2 -0
- data/examples/rails2/app/helpers/members_helper.rb +2 -0
- data/examples/rails2/app/models/group.rb +2 -0
- data/examples/rails2/app/models/member.rb +3 -0
- data/examples/rails2/app/views/groups/_form.html +30 -0
- data/examples/rails2/app/views/groups/_form.plogic +11 -0
- data/examples/rails2/app/views/groups/_link.plogic +19 -0
- data/examples/rails2/app/views/groups/_read.plogic +7 -0
- data/examples/rails2/app/views/groups/edit.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/edit.html +26 -0
- data/examples/rails2/app/views/groups/edit.plogic +9 -0
- data/examples/rails2/app/views/groups/list.html +48 -0
- data/examples/rails2/app/views/groups/list.plogic +32 -0
- data/examples/rails2/app/views/groups/new.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/new.html +27 -0
- data/examples/rails2/app/views/groups/new.plogic +9 -0
- data/examples/rails2/app/views/groups/show.html +27 -0
- data/examples/rails2/app/views/groups/show.plogic +2 -0
- data/examples/rails2/app/views/layouts/groups.html +23 -0
- data/examples/rails2/app/views/layouts/groups.plogic +11 -0
- data/examples/rails2/app/views/layouts/members.html +23 -0
- data/examples/rails2/app/views/layouts/members.plogic +11 -0
- data/examples/rails2/app/views/layouts/members2.html +24 -0
- data/examples/rails2/app/views/layouts/members2.plogic +11 -0
- data/examples/rails2/app/views/members/_form.plogic +27 -0
- data/examples/rails2/app/views/members/_link.plogic +19 -0
- data/examples/rails2/app/views/members/_read.plogic +29 -0
- data/examples/rails2/app/views/members/edit.cfg.yaml +6 -0
- data/examples/rails2/app/views/members/edit.html +27 -0
- data/examples/rails2/app/views/members/edit.plogic +10 -0
- data/examples/rails2/app/views/members/list.html +53 -0
- data/examples/rails2/app/views/members/list.plogic +32 -0
- data/examples/rails2/app/views/members/new.html +61 -0
- data/examples/rails2/app/views/members/new.plogic +17 -0
- data/examples/rails2/app/views/members/show.html +41 -0
- data/examples/rails2/app/views/members/show.plogic +3 -0
- data/examples/rails2/db/create-tables.mysql.sql +27 -0
- data/examples/rails2/db/create-tables.pgsql.sql +27 -0
- data/examples/rails2/db/insert-data.sql +21 -0
- data/examples/rails2/db/tabledef.yaml +51 -0
- data/kwartz.gemspec +4 -4
- data/lib/kwartz.rb +10 -2
- data/lib/kwartz/assert.rb +1 -1
- data/lib/kwartz/binding/eperl.rb +85 -61
- data/lib/kwartz/binding/erubis.rb +6 -8
- data/lib/kwartz/binding/eruby.rb +5 -120
- data/lib/kwartz/binding/jstl.rb +116 -101
- data/lib/kwartz/binding/php.rb +79 -60
- data/lib/kwartz/binding/pierubis.rb +58 -0
- data/lib/kwartz/binding/rails.rb +45 -42
- data/lib/kwartz/binding/ruby.rb +193 -0
- data/lib/kwartz/binding/struts.rb +1 -1
- data/lib/kwartz/config.rb +4 -3
- data/lib/kwartz/converter.rb +231 -68
- data/lib/kwartz/defun.rb +126 -0
- data/lib/kwartz/error.rb +1 -1
- data/lib/kwartz/helper/rails.rb +437 -0
- data/lib/kwartz/main.rb +30 -38
- data/lib/kwartz/node.rb +46 -31
- data/lib/kwartz/parser.rb +43 -15
- data/lib/kwartz/translator.rb +104 -6
- data/lib/kwartz/util.rb +113 -0
- data/lib/kwartz/util/assert-text-equal.rb +1 -1
- data/lib/kwartz/util/testcase-helper.rb +26 -8
- data/test/test-compile.rb +3 -3
- data/test/test-compile.yaml +135 -5
- data/test/test-converter.rb +16 -8
- data/test/test-converter.yaml +307 -76
- data/test/test-directives.rb +1 -1
- data/test/test-directives.yaml +964 -979
- data/test/test-main.rb +61 -146
- data/test/test-main.yaml +235 -0
- data/test/test-parser.rb +10 -12
- data/test/test-parser.yaml +484 -326
- data/test/test-rails.rb +1 -1
- data/test/test-rails.yaml +37 -37
- data/test/test-ruleset.rb +1 -1
- data/test/test-ruleset.yaml +34 -40
- data/test/test.rb +1 -1
- metadata +82 -3
- data/COPYING +0 -340
@@ -94,20 +94,20 @@ directive handler for JSTL
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
97
|
+
<a href="#M000098">_evaluate_options</a>
|
98
|
+
<a href="#M000096">_handle_jstl_params</a>
|
99
|
+
<a href="#M000097">_handle_jstl_tag</a>
|
100
|
+
<a href="#M000088">directive_format</a>
|
101
|
+
<a href="#M000086">directive_pattern</a>
|
102
|
+
<a href="#M000089">handle</a>
|
103
|
+
<a href="#M000094">handle_jstl_forEach</a>
|
104
|
+
<a href="#M000095">handle_jstl_forTokens</a>
|
105
|
+
<a href="#M000091">handle_jstl_import</a>
|
106
|
+
<a href="#M000090">handle_jstl_redirect</a>
|
107
|
+
<a href="#M000093">handle_jstl_remove</a>
|
108
|
+
<a href="#M000092">handle_jstl_url</a>
|
109
|
+
<a href="#M000087">mapping_pattern</a>
|
110
|
+
<a href="#M000085">new</a>
|
111
111
|
</div>
|
112
112
|
</div>
|
113
113
|
|
@@ -152,24 +152,24 @@ directive handler for JSTL
|
|
152
152
|
<div id="methods">
|
153
153
|
<h3 class="section-bar">Public Class methods</h3>
|
154
154
|
|
155
|
-
<div id="method-
|
156
|
-
<a name="
|
155
|
+
<div id="method-M000085" class="method-detail">
|
156
|
+
<a name="M000085"></a>
|
157
157
|
|
158
158
|
<div class="method-heading">
|
159
|
-
<a href="#
|
159
|
+
<a href="#M000085" class="method-signature">
|
160
160
|
<span class="method-name">new</span><span class="method-args">(elem_rulesets=[], properties={})</span>
|
161
161
|
</a>
|
162
162
|
</div>
|
163
163
|
|
164
164
|
<div class="method-description">
|
165
165
|
<p><a class="source-toggle" href="#"
|
166
|
-
onclick="toggleCode('
|
167
|
-
<div class="method-source-code" id="
|
166
|
+
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
|
167
|
+
<div class="method-source-code" id="M000085-source">
|
168
168
|
<pre>
|
169
169
|
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 23</span>
|
170
170
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">elem_rulesets</span>=[], <span class="ruby-identifier">properties</span>={})
|
171
171
|
<span class="ruby-keyword kw">super</span>
|
172
|
-
<span class="ruby-ivar">@jstl_ver</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:jstl</span>] <span class="ruby-operator">||</span> <span class="ruby-
|
172
|
+
<span class="ruby-ivar">@jstl_ver</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:jstl</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">PROPERTY_JSTL</span>
|
173
173
|
<span class="ruby-keyword kw">end</span>
|
174
174
|
</pre>
|
175
175
|
</div>
|
@@ -178,19 +178,19 @@ directive handler for JSTL
|
|
178
178
|
|
179
179
|
<h3 class="section-bar">Public Instance methods</h3>
|
180
180
|
|
181
|
-
<div id="method-
|
182
|
-
<a name="
|
181
|
+
<div id="method-M000088" class="method-detail">
|
182
|
+
<a name="M000088"></a>
|
183
183
|
|
184
184
|
<div class="method-heading">
|
185
|
-
<a href="#
|
185
|
+
<a href="#M000088" class="method-signature">
|
186
186
|
<span class="method-name">directive_format</span><span class="method-args">()</span>
|
187
187
|
</a>
|
188
188
|
</div>
|
189
189
|
|
190
190
|
<div class="method-description">
|
191
191
|
<p><a class="source-toggle" href="#"
|
192
|
-
onclick="toggleCode('
|
193
|
-
<div class="method-source-code" id="
|
192
|
+
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
|
193
|
+
<div class="method-source-code" id="M000088-source">
|
194
194
|
<pre>
|
195
195
|
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 45</span>
|
196
196
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_format</span>
|
@@ -201,19 +201,19 @@ directive handler for JSTL
|
|
201
201
|
</div>
|
202
202
|
</div>
|
203
203
|
|
204
|
-
<div id="method-
|
205
|
-
<a name="
|
204
|
+
<div id="method-M000086" class="method-detail">
|
205
|
+
<a name="M000086"></a>
|
206
206
|
|
207
207
|
<div class="method-heading">
|
208
|
-
<a href="#
|
208
|
+
<a href="#M000086" class="method-signature">
|
209
209
|
<span class="method-name">directive_pattern</span><span class="method-args">()</span>
|
210
210
|
</a>
|
211
211
|
</div>
|
212
212
|
|
213
213
|
<div class="method-description">
|
214
214
|
<p><a class="source-toggle" href="#"
|
215
|
-
onclick="toggleCode('
|
216
|
-
<div class="method-source-code" id="
|
215
|
+
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
|
216
|
+
<div class="method-source-code" id="M000086-source">
|
217
217
|
<pre>
|
218
218
|
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 31</span>
|
219
219
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_pattern</span>
|
@@ -224,143 +224,149 @@ directive handler for JSTL
|
|
224
224
|
</div>
|
225
225
|
</div>
|
226
226
|
|
227
|
-
<div id="method-
|
228
|
-
<a name="
|
227
|
+
<div id="method-M000089" class="method-detail">
|
228
|
+
<a name="M000089"></a>
|
229
229
|
|
230
230
|
<div class="method-heading">
|
231
|
-
<a href="#
|
232
|
-
<span class="method-name">handle</span><span class="method-args">(
|
231
|
+
<a href="#M000089" class="method-signature">
|
232
|
+
<span class="method-name">handle</span><span class="method-args">(stmt_list, handler_arg)</span>
|
233
233
|
</a>
|
234
234
|
</div>
|
235
235
|
|
236
236
|
<div class="method-description">
|
237
237
|
<p><a class="source-toggle" href="#"
|
238
|
-
onclick="toggleCode('
|
239
|
-
<div class="method-source-code" id="
|
238
|
+
onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
|
239
|
+
<div class="method-source-code" id="M000089-source">
|
240
240
|
<pre>
|
241
241
|
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 50</span>
|
242
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">
|
242
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">handler_arg</span>)
|
243
243
|
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">super</span>
|
244
244
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span>
|
245
245
|
|
246
|
-
<span class="ruby-identifier">
|
247
|
-
<span class="ruby-identifier">
|
248
|
-
<span class="ruby-identifier">
|
246
|
+
<span class="ruby-identifier">arg</span> = <span class="ruby-identifier">handler_arg</span>
|
247
|
+
<span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_name</span>
|
248
|
+
<span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_arg</span>
|
249
|
+
<span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_str</span>
|
249
250
|
|
250
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">
|
251
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">d_name</span>
|
251
252
|
|
252
253
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:for</span>, <span class="ruby-identifier">:For</span>, <span class="ruby-identifier">:FOR</span>, <span class="ruby-identifier">:list</span>, <span class="ruby-identifier">:List</span>, <span class="ruby-identifier">:LIST</span>
|
253
254
|
<span class="ruby-identifier">is_foreach</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:For</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:FOR</span>
|
255
|
+
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">is_foreach</span>
|
254
256
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\w+)\s*:\s*(.*)\z/</span>
|
255
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid argument."</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
257
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid argument."</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
256
258
|
<span class="ruby-keyword kw">end</span>
|
257
259
|
<span class="ruby-identifier">loopvar</span> = <span class="ruby-identifier">$1</span> ; <span class="ruby-identifier">looplist</span> = <span class="ruby-identifier">$2</span>
|
258
260
|
<span class="ruby-identifier">counter</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:list</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">"#{loopvar}_ctr"</span>
|
259
261
|
<span class="ruby-identifier">toggle</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:FOR</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:LIST</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">"#{loopvar}_tgl"</span>
|
260
262
|
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:list</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">"#{loopvar}_status"</span>
|
261
|
-
<span class="ruby-identifier">
|
262
|
-
<span class="ruby-identifier">
|
263
|
-
<span class="ruby-identifier">
|
264
|
-
<span class="ruby-identifier">
|
265
|
-
<span class="ruby-identifier">
|
266
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
|
267
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"<c:set var=\"#{counter}\" value=\"${#{status}.count}\" />"</span>)
|
268
|
-
<span class="ruby-keyword kw">end</span>
|
263
|
+
<span class="ruby-identifier">foreach_code</span> = <span class="ruby-node">"<c:forEach var=\"#{loopvar}\" items=\"${#{looplist}}\""</span>
|
264
|
+
<span class="ruby-identifier">foreach_code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" varStatus=\"#{status}\""</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span>
|
265
|
+
<span class="ruby-identifier">foreach_code</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">">"</span>
|
266
|
+
<span class="ruby-identifier">code</span> = []
|
267
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">foreach_code</span>
|
268
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<c:set var=\"#{counter}\" value=\"${#{status}.count}\"/>"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
|
269
269
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">toggle</span>
|
270
270
|
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@jstl_ver</span> <span class="ruby-operator"><</span> <span class="ruby-value">1.2</span>
|
271
|
-
<span class="ruby-identifier">
|
272
|
-
<span class="ruby-identifier">
|
273
|
-
<span class="ruby-identifier">
|
274
|
-
<span class="ruby-identifier">
|
275
|
-
<span class="ruby-identifier">
|
271
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<c:choose><c:when test=\"${#{status}.count%2==0}\">"</span>
|
272
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<c:set var=\"#{toggle}\" value=\"${self.even}\"/>"</span>
|
273
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</c:when><c:otherwise>"</span>
|
274
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<c:set var=\"#{toggle}\" value=\"${self.odd}\"/>"</span>
|
275
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</c:otherwise></c:choose>"</span>
|
276
276
|
<span class="ruby-keyword kw">else</span>
|
277
|
-
<span class="ruby-identifier">
|
278
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>)
|
277
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<c:set var=\"#{toggle}\" value=\"${#{status}.count%2==0 ? #{self.even} : #{self.odd}}\"/>"</span>
|
279
278
|
<span class="ruby-keyword kw">end</span>
|
280
279
|
<span class="ruby-keyword kw">end</span>
|
281
|
-
<span class="ruby-identifier">
|
282
|
-
<span class="ruby-
|
283
|
-
|
284
|
-
<span class="ruby-
|
285
|
-
|
280
|
+
<span class="ruby-identifier">end_code</span> = <span class="ruby-value str">"</c:forEach>"</span>
|
281
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_foreach</span>
|
282
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">:set</span>)
|
283
|
+
<span class="ruby-keyword kw">else</span>
|
284
|
+
<span class="ruby-identifier">wrap_content_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">:set</span>)
|
285
|
+
<span class="ruby-keyword kw">end</span>
|
286
286
|
|
287
287
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:while</span>, <span class="ruby-identifier">:loop</span>
|
288
|
-
<span class="ruby-identifier">
|
288
|
+
<span class="ruby-identifier">msg</span> = <span class="ruby-node">"'#{d_str}': jstl doesn't support '#{d_arg}' directive."</span>
|
289
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
289
290
|
|
290
291
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:set</span>
|
291
292
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\S+)\s*=\s*(.*)\z/</span>
|
292
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid argument."</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
293
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid argument."</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
293
294
|
<span class="ruby-keyword kw">end</span>
|
294
295
|
<span class="ruby-identifier">lhs</span> = <span class="ruby-identifier">$1</span>; <span class="ruby-identifier">rhs</span> = <span class="ruby-identifier">$2</span>
|
295
|
-
<span class="ruby-identifier">
|
296
|
-
<span class="ruby-identifier">
|
297
|
-
<span class="ruby-
|
298
|
-
<span class="ruby-
|
299
|
-
<span class="ruby-
|
296
|
+
<span class="ruby-identifier">code</span> = <span class="ruby-node">"<c:set var=\"#{lhs}\" value=\"${#{rhs}}\"/>"</span>
|
297
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:set</span>)
|
298
|
+
<span class="ruby-comment cmt">#code = "<c:set var=\"#{lhs}\" value=\"${#{rhs}}\"/>"</span>
|
299
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(code, :set)</span>
|
300
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
301
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
302
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
300
303
|
|
301
304
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:if</span>
|
302
|
-
<span class="ruby-identifier">
|
303
|
-
<span class="ruby-identifier">
|
304
|
-
<span class="ruby-identifier">
|
305
|
-
<span class="ruby-
|
306
|
-
<span class="ruby-
|
307
|
-
<span class="ruby-
|
305
|
+
<span class="ruby-identifier">start_code</span> = <span class="ruby-node">"<c:choose><c:when test=\"${#{d_arg}}\">"</span>
|
306
|
+
<span class="ruby-identifier">end_code</span> = <span class="ruby-value str">"</c:when></c:choose>"</span>
|
307
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">start_code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">:if</span>)
|
308
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(start_code, :if)</span>
|
309
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
310
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
311
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
312
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(end, :if)</span>
|
308
313
|
|
309
314
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:elseif</span>, <span class="ruby-identifier">:else</span>
|
310
|
-
<span class="ruby-
|
311
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': previous statement should be 'if' or 'elseif'."</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
312
|
-
<span class="ruby-keyword kw">end</span>
|
315
|
+
<span class="ruby-identifier">error_when_last_stmt_is_not_if</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>)
|
313
316
|
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">pop</span> <span class="ruby-comment cmt"># delete '</c:when></c:choose>'</span>
|
314
317
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:else</span>
|
315
318
|
<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:else</span>
|
316
|
-
<span class="ruby-identifier">
|
317
|
-
<span class="ruby-identifier">
|
318
|
-
<span class="ruby-identifier">sb</span> = <span class="ruby-value str">"</c:otherwise></c:choose>"</span>
|
319
|
+
<span class="ruby-identifier">start_code</span> = <span class="ruby-value str">"</c:when><c:otherwise>"</span>
|
320
|
+
<span class="ruby-identifier">end_code</span> = <span class="ruby-value str">"</c:otherwise></c:choose>"</span>
|
319
321
|
<span class="ruby-keyword kw">else</span>
|
320
322
|
<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:elseif</span>
|
321
|
-
<span class="ruby-identifier">
|
322
|
-
<span class="ruby-identifier">
|
323
|
-
<span class="ruby-identifier">sb</span> = <span class="ruby-value str">"</c:when></c:choose>"</span>
|
323
|
+
<span class="ruby-identifier">start_code</span> = <span class="ruby-node">"</c:when><c:when test=\"${#{d_arg}}\">"</span>
|
324
|
+
<span class="ruby-identifier">end_code</span> = <span class="ruby-value str">"</c:when></c:choose>"</span>
|
324
325
|
<span class="ruby-keyword kw">end</span>
|
325
|
-
<span class="ruby-identifier">
|
326
|
-
<span class="ruby-
|
327
|
-
<span class="ruby-
|
328
|
-
<span class="ruby-
|
326
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">start_code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">kind</span>)
|
327
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(start_code, kind)</span>
|
328
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt</span>
|
329
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
330
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt</span>
|
331
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(end_code, kind)</span>
|
329
332
|
|
330
333
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:default</span>, <span class="ruby-identifier">:Default</span>, <span class="ruby-identifier">:DEFAULT</span>
|
331
|
-
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">
|
332
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">
|
334
|
+
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
|
335
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">stag_stmt</span>(<span class="ruby-identifier">arg</span>)
|
333
336
|
<span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:default</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Default</span>)
|
334
|
-
<span class="ruby-identifier">argstr</span> = <span class="ruby-identifier">cont_stmts</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
|
335
|
-
<span class="ruby-identifier">
|
336
|
-
<span class="ruby-identifier">
|
337
|
-
<span class="ruby-identifier">
|
338
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new_without_newline</span>(<span class="ruby-identifier">
|
339
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">
|
337
|
+
<span class="ruby-identifier">argstr</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
|
338
|
+
<span class="ruby-identifier">code</span> = <span class="ruby-node">"<c:out value=\"${#{d_arg}}\""</span>
|
339
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" escapeXml=\"#{flag_escape}\""</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">flag_escape</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
340
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" default=\"#{argstr}\"/>"</span>
|
341
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new_without_newline</span>(<span class="ruby-identifier">code</span>)
|
342
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">etag_stmt</span>(<span class="ruby-identifier">arg</span>)
|
340
343
|
|
341
344
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:catch</span>
|
342
345
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/\A\w+\z/</span>
|
343
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid varname."</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
346
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid varname."</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
344
347
|
<span class="ruby-keyword kw">end</span>
|
345
|
-
<span class="ruby-identifier">
|
346
|
-
<span class="ruby-identifier">
|
347
|
-
<span class="ruby-identifier">
|
348
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">
|
349
|
-
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
|
348
|
+
<span class="ruby-identifier">code</span> = <span class="ruby-value str">"<c:catch"</span>
|
349
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" var=\"#{d_arg}\""</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">empty?</span>
|
350
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">">"</span>
|
351
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">code</span>)
|
352
|
+
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>)
|
350
353
|
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"</c:catch>"</span>)
|
351
354
|
|
352
355
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:forEach</span>, <span class="ruby-identifier">:forTokens</span>
|
353
|
-
<span class="ruby-identifier">
|
354
|
-
<span class="ruby-identifier">
|
355
|
-
<span class="ruby-identifier">
|
356
|
-
<span class="ruby-
|
357
|
-
<span class="ruby-
|
358
|
-
<span class="ruby-
|
356
|
+
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">eval</span> <span class="ruby-node">"{ #{d_arg} }"</span>
|
357
|
+
<span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">__send__</span> <span class="ruby-node">"handle_jstl_#{d_name}"</span>, <span class="ruby-identifier">options</span>
|
358
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span>, <span class="ruby-keyword kw">nil</span>)
|
359
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(stag)</span>
|
360
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt</span>
|
361
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
362
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt</span>
|
363
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(etag)</span>
|
359
364
|
|
360
365
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:redirect</span>, <span class="ruby-identifier">:import</span>, <span class="ruby-identifier">:url</span>, <span class="ruby-identifier">:remove</span>
|
361
|
-
<span class="ruby-identifier">
|
366
|
+
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">eval</span> <span class="ruby-node">"{ #{d_arg} }"</span>
|
367
|
+
<span class="ruby-identifier">lines</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">__send__</span> <span class="ruby-node">"handle_jstl_#{d_name}"</span>, <span class="ruby-identifier">options</span>
|
362
368
|
<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
363
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">line</span>)
|
369
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>)
|
364
370
|
<span class="ruby-keyword kw">end</span>
|
365
371
|
|
366
372
|
<span class="ruby-keyword kw">else</span>
|
@@ -375,19 +381,19 @@ directive handler for JSTL
|
|
375
381
|
</div>
|
376
382
|
</div>
|
377
383
|
|
378
|
-
<div id="method-
|
379
|
-
<a name="
|
384
|
+
<div id="method-M000087" class="method-detail">
|
385
|
+
<a name="M000087"></a>
|
380
386
|
|
381
387
|
<div class="method-heading">
|
382
|
-
<a href="#
|
388
|
+
<a href="#M000087" class="method-signature">
|
383
389
|
<span class="method-name">mapping_pattern</span><span class="method-args">()</span>
|
384
390
|
</a>
|
385
391
|
</div>
|
386
392
|
|
387
393
|
<div class="method-description">
|
388
394
|
<p><a class="source-toggle" href="#"
|
389
|
-
onclick="toggleCode('
|
390
|
-
<div class="method-source-code" id="
|
395
|
+
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
|
396
|
+
<div class="method-source-code" id="M000087-source">
|
391
397
|
<pre>
|
392
398
|
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 38</span>
|
393
399
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapping_pattern</span>
|
@@ -400,21 +406,21 @@ directive handler for JSTL
|
|
400
406
|
|
401
407
|
<h3 class="section-bar">Protected Instance methods</h3>
|
402
408
|
|
403
|
-
<div id="method-
|
404
|
-
<a name="
|
409
|
+
<div id="method-M000098" class="method-detail">
|
410
|
+
<a name="M000098"></a>
|
405
411
|
|
406
412
|
<div class="method-heading">
|
407
|
-
<a href="#
|
413
|
+
<a href="#M000098" class="method-signature">
|
408
414
|
<span class="method-name">_evaluate_options</span><span class="method-args">(options={})</span>
|
409
415
|
</a>
|
410
416
|
</div>
|
411
417
|
|
412
418
|
<div class="method-description">
|
413
419
|
<p><a class="source-toggle" href="#"
|
414
|
-
onclick="toggleCode('
|
415
|
-
<div class="method-source-code" id="
|
420
|
+
onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
|
421
|
+
<div class="method-source-code" id="M000098-source">
|
416
422
|
<pre>
|
417
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
423
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 276</span>
|
418
424
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_evaluate_options</span>(<span class="ruby-identifier">options</span>={})
|
419
425
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
|
420
426
|
<span class="ruby-keyword kw">end</span>
|
@@ -423,73 +429,82 @@ directive handler for JSTL
|
|
423
429
|
</div>
|
424
430
|
</div>
|
425
431
|
|
426
|
-
<div id="method-
|
427
|
-
<a name="
|
432
|
+
<div id="method-M000096" class="method-detail">
|
433
|
+
<a name="M000096"></a>
|
428
434
|
|
429
435
|
<div class="method-heading">
|
430
|
-
<a href="#
|
436
|
+
<a href="#M000096" class="method-signature">
|
431
437
|
<span class="method-name">_handle_jstl_params</span><span class="method-args">(tagname, param_list, options)</span>
|
432
438
|
</a>
|
433
439
|
</div>
|
434
440
|
|
435
441
|
<div class="method-description">
|
436
442
|
<p><a class="source-toggle" href="#"
|
437
|
-
onclick="toggleCode('
|
438
|
-
<div class="method-source-code" id="
|
443
|
+
onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
|
444
|
+
<div class="method-source-code" id="M000096-source">
|
439
445
|
<pre>
|
440
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
446
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 224</span>
|
441
447
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
|
442
|
-
<span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span> = <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
|
443
|
-
<span class="ruby-identifier">lines</span> = [<span class="ruby-identifier">stag</span>]
|
448
|
+
<span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span> = <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>, <span class="ruby-keyword kw">true</span>)
|
444
449
|
<span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
445
|
-
<span class="ruby-identifier">
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
<span class="ruby-keyword kw">else</span>
|
450
|
-
<span class="ruby-comment cmt">#lines << " <c:param name=\"#{name}\" value=\"#{value}\"/>"</span>
|
451
|
-
<span class="ruby-keyword kw">end</span>
|
452
|
-
<span class="ruby-keyword kw">end</span>
|
453
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
454
|
-
<span class="ruby-identifier">stag</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/>\z/</span>, <span class="ruby-value str">'/>'</span>)
|
450
|
+
<span class="ruby-identifier">unknown_param_names</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">param_list</span>
|
451
|
+
<span class="ruby-identifier">lines</span> = []
|
452
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">unknown_param_names</span>.<span class="ruby-identifier">empty?</span>
|
453
|
+
<span class="ruby-identifier">lines</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">stag</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/>\z/</span>, <span class="ruby-value str">'/>'</span>)
|
455
454
|
<span class="ruby-keyword kw">else</span>
|
455
|
+
<span class="ruby-identifier">lines</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">stag</span>
|
456
|
+
<span class="ruby-identifier">unknown_param_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
457
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">name</span>]
|
458
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
|
459
|
+
<span class="ruby-identifier">lines</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <c:param name=\"#{name}\" value=\"${#{value}}\"/>"</span>
|
460
|
+
<span class="ruby-keyword kw">else</span>
|
461
|
+
<span class="ruby-identifier">lines</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <c:param name=\"#{name}\" value=\"#{value}\"/>"</span>
|
462
|
+
<span class="ruby-keyword kw">end</span>
|
463
|
+
<span class="ruby-keyword kw">end</span>
|
456
464
|
<span class="ruby-identifier">lines</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">etag</span>
|
457
465
|
<span class="ruby-keyword kw">end</span>
|
458
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lines</span>
|
466
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>)
|
459
467
|
<span class="ruby-keyword kw">end</span>
|
460
468
|
</pre>
|
461
469
|
</div>
|
462
470
|
</div>
|
463
471
|
</div>
|
464
472
|
|
465
|
-
<div id="method-
|
466
|
-
<a name="
|
473
|
+
<div id="method-M000097" class="method-detail">
|
474
|
+
<a name="M000097"></a>
|
467
475
|
|
468
476
|
<div class="method-heading">
|
469
|
-
<a href="#
|
470
|
-
<span class="method-name">_handle_jstl_tag</span><span class="method-args">(tagname, param_list, options)</span>
|
477
|
+
<a href="#M000097" class="method-signature">
|
478
|
+
<span class="method-name">_handle_jstl_tag</span><span class="method-args">(tagname, param_list, options, ignore_unknown_option=false)</span>
|
471
479
|
</a>
|
472
480
|
</div>
|
473
481
|
|
474
482
|
<div class="method-description">
|
475
483
|
<p><a class="source-toggle" href="#"
|
476
|
-
onclick="toggleCode('
|
477
|
-
<div class="method-source-code" id="
|
484
|
+
onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
|
485
|
+
<div class="method-source-code" id="M000097-source">
|
478
486
|
<pre>
|
479
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
480
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
|
481
|
-
<span class="ruby-identifier">
|
482
|
-
|
483
|
-
<span class="ruby-identifier">
|
484
|
-
|
485
|
-
|
487
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 247</span>
|
488
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">ignore_unknown_option</span>=<span class="ruby-keyword kw">false</span>)
|
489
|
+
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
490
|
+
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
491
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">name</span>)
|
492
|
+
<span class="ruby-keyword kw">end</span>
|
493
|
+
<span class="ruby-identifier">option_names</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">keys</span>
|
494
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ignore_unknown_option</span>
|
495
|
+
<span class="ruby-identifier">unkown_option_names</span> = <span class="ruby-identifier">option_names</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">param_list</span>
|
496
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">unkown_option_names</span>.<span class="ruby-identifier">empty?</span>
|
497
|
+
<span class="ruby-identifier">msg</span> = <span class="ruby-node">"'#{unkown_option_names[0]}': unknown option for '#{tagname}' directive."</span>
|
498
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-keyword kw">nil</span>) <span class="ruby-comment cmt"># TODO</span>
|
486
499
|
<span class="ruby-keyword kw">end</span>
|
487
|
-
|
488
|
-
|
500
|
+
<span class="ruby-keyword kw">end</span>
|
501
|
+
<span class="ruby-identifier">sb</span> = <span class="ruby-node">"<c:#{tagname}"</span>
|
502
|
+
(<span class="ruby-identifier">param_list</span> <span class="ruby-operator">&</span> <span class="ruby-identifier">option_names</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
503
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">name</span>]
|
489
504
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
|
490
|
-
<span class="ruby-identifier">sb</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{
|
505
|
+
<span class="ruby-identifier">sb</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{name}=\"${#{value}}\""</span>
|
491
506
|
<span class="ruby-keyword kw">else</span>
|
492
|
-
<span class="ruby-identifier">sb</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{
|
507
|
+
<span class="ruby-identifier">sb</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{name}=\"#{value}\""</span>
|
493
508
|
<span class="ruby-keyword kw">end</span>
|
494
509
|
<span class="ruby-keyword kw">end</span>
|
495
510
|
<span class="ruby-identifier">sb</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">">"</span>
|
@@ -502,21 +517,21 @@ directive handler for JSTL
|
|
502
517
|
</div>
|
503
518
|
</div>
|
504
519
|
|
505
|
-
<div id="method-
|
506
|
-
<a name="
|
520
|
+
<div id="method-M000094" class="method-detail">
|
521
|
+
<a name="M000094"></a>
|
507
522
|
|
508
523
|
<div class="method-heading">
|
509
|
-
<a href="#
|
524
|
+
<a href="#M000094" class="method-signature">
|
510
525
|
<span class="method-name">handle_jstl_forEach</span><span class="method-args">(options)</span>
|
511
526
|
</a>
|
512
527
|
</div>
|
513
528
|
|
514
529
|
<div class="method-description">
|
515
530
|
<p><a class="source-toggle" href="#"
|
516
|
-
onclick="toggleCode('
|
517
|
-
<div class="method-source-code" id="
|
531
|
+
onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
|
532
|
+
<div class="method-source-code" id="M000094-source">
|
518
533
|
<pre>
|
519
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
534
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 212</span>
|
520
535
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_forEach</span>(<span class="ruby-identifier">options</span>)
|
521
536
|
<span class="ruby-identifier">param_list</span> = <span class="ruby-node">%w[var items varStatus begin end step]</span>
|
522
537
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-value str">'forEach'</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
|
@@ -526,21 +541,21 @@ directive handler for JSTL
|
|
526
541
|
</div>
|
527
542
|
</div>
|
528
543
|
|
529
|
-
<div id="method-
|
530
|
-
<a name="
|
544
|
+
<div id="method-M000095" class="method-detail">
|
545
|
+
<a name="M000095"></a>
|
531
546
|
|
532
547
|
<div class="method-heading">
|
533
|
-
<a href="#
|
548
|
+
<a href="#M000095" class="method-signature">
|
534
549
|
<span class="method-name">handle_jstl_forTokens</span><span class="method-args">(options)</span>
|
535
550
|
</a>
|
536
551
|
</div>
|
537
552
|
|
538
553
|
<div class="method-description">
|
539
554
|
<p><a class="source-toggle" href="#"
|
540
|
-
onclick="toggleCode('
|
541
|
-
<div class="method-source-code" id="
|
555
|
+
onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
|
556
|
+
<div class="method-source-code" id="M000095-source">
|
542
557
|
<pre>
|
543
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
558
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 218</span>
|
544
559
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_forTokens</span>(<span class="ruby-identifier">options</span>)
|
545
560
|
<span class="ruby-identifier">param_list</span> = <span class="ruby-node">%w[items delims var varStatus begin end step]</span>
|
546
561
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-value str">'forTokens'</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
|
@@ -550,21 +565,21 @@ directive handler for JSTL
|
|
550
565
|
</div>
|
551
566
|
</div>
|
552
567
|
|
553
|
-
<div id="method-
|
554
|
-
<a name="
|
568
|
+
<div id="method-M000091" class="method-detail">
|
569
|
+
<a name="M000091"></a>
|
555
570
|
|
556
571
|
<div class="method-heading">
|
557
|
-
<a href="#
|
572
|
+
<a href="#M000091" class="method-signature">
|
558
573
|
<span class="method-name">handle_jstl_import</span><span class="method-args">(options)</span>
|
559
574
|
</a>
|
560
575
|
</div>
|
561
576
|
|
562
577
|
<div class="method-description">
|
563
578
|
<p><a class="source-toggle" href="#"
|
564
|
-
onclick="toggleCode('
|
565
|
-
<div class="method-source-code" id="
|
579
|
+
onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
|
580
|
+
<div class="method-source-code" id="M000091-source">
|
566
581
|
<pre>
|
567
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
582
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 197</span>
|
568
583
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_import</span>(<span class="ruby-identifier">options</span>)
|
569
584
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'import'</span>, <span class="ruby-node">%w[url context charEncoding var scope]</span>, <span class="ruby-identifier">options</span>)
|
570
585
|
<span class="ruby-keyword kw">end</span>
|
@@ -573,21 +588,21 @@ directive handler for JSTL
|
|
573
588
|
</div>
|
574
589
|
</div>
|
575
590
|
|
576
|
-
<div id="method-
|
577
|
-
<a name="
|
591
|
+
<div id="method-M000090" class="method-detail">
|
592
|
+
<a name="M000090"></a>
|
578
593
|
|
579
594
|
<div class="method-heading">
|
580
|
-
<a href="#
|
595
|
+
<a href="#M000090" class="method-signature">
|
581
596
|
<span class="method-name">handle_jstl_redirect</span><span class="method-args">(options)</span>
|
582
597
|
</a>
|
583
598
|
</div>
|
584
599
|
|
585
600
|
<div class="method-description">
|
586
601
|
<p><a class="source-toggle" href="#"
|
587
|
-
onclick="toggleCode('
|
588
|
-
<div class="method-source-code" id="
|
602
|
+
onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
|
603
|
+
<div class="method-source-code" id="M000090-source">
|
589
604
|
<pre>
|
590
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
605
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 192</span>
|
591
606
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_redirect</span>(<span class="ruby-identifier">options</span>)
|
592
607
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'redirect'</span>, <span class="ruby-node">%w[url context]</span>, <span class="ruby-identifier">options</span>)
|
593
608
|
<span class="ruby-keyword kw">end</span>
|
@@ -596,21 +611,21 @@ directive handler for JSTL
|
|
596
611
|
</div>
|
597
612
|
</div>
|
598
613
|
|
599
|
-
<div id="method-
|
600
|
-
<a name="
|
614
|
+
<div id="method-M000093" class="method-detail">
|
615
|
+
<a name="M000093"></a>
|
601
616
|
|
602
617
|
<div class="method-heading">
|
603
|
-
<a href="#
|
618
|
+
<a href="#M000093" class="method-signature">
|
604
619
|
<span class="method-name">handle_jstl_remove</span><span class="method-args">(options)</span>
|
605
620
|
</a>
|
606
621
|
</div>
|
607
622
|
|
608
623
|
<div class="method-description">
|
609
624
|
<p><a class="source-toggle" href="#"
|
610
|
-
onclick="toggleCode('
|
611
|
-
<div class="method-source-code" id="
|
625
|
+
onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
|
626
|
+
<div class="method-source-code" id="M000093-source">
|
612
627
|
<pre>
|
613
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
628
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 207</span>
|
614
629
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_remove</span>(<span class="ruby-identifier">options</span>)
|
615
630
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'remove'</span>, <span class="ruby-node">%w[var scope]</span>, <span class="ruby-identifier">options</span>)
|
616
631
|
<span class="ruby-keyword kw">end</span>
|
@@ -619,21 +634,21 @@ directive handler for JSTL
|
|
619
634
|
</div>
|
620
635
|
</div>
|
621
636
|
|
622
|
-
<div id="method-
|
623
|
-
<a name="
|
637
|
+
<div id="method-M000092" class="method-detail">
|
638
|
+
<a name="M000092"></a>
|
624
639
|
|
625
640
|
<div class="method-heading">
|
626
|
-
<a href="#
|
641
|
+
<a href="#M000092" class="method-signature">
|
627
642
|
<span class="method-name">handle_jstl_url</span><span class="method-args">(options)</span>
|
628
643
|
</a>
|
629
644
|
</div>
|
630
645
|
|
631
646
|
<div class="method-description">
|
632
647
|
<p><a class="source-toggle" href="#"
|
633
|
-
onclick="toggleCode('
|
634
|
-
<div class="method-source-code" id="
|
648
|
+
onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
|
649
|
+
<div class="method-source-code" id="M000092-source">
|
635
650
|
<pre>
|
636
|
-
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line
|
651
|
+
<span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 202</span>
|
637
652
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_url</span>(<span class="ruby-identifier">options</span>)
|
638
653
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'url'</span>, <span class="ruby-node">%w[value context var scope]</span>, <span class="ruby-identifier">options</span>)
|
639
654
|
<span class="ruby-keyword kw">end</span>
|