summaryrefslogtreecommitdiff
path: root/apidocs/com/amazon/carbonado/gen/CodeBuilderUtil.html
blob: c20d420087e01bed29cb572e3714d8f4daf4a772 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_25) on Tue Dec 03 13:53:43 PST 2013 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>CodeBuilderUtil (Carbonado 1.2.3 API)</title>
<meta name="date" content="2013-12-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="CodeBuilderUtil (Carbonado 1.2.3 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CodeBuilderUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../com/amazon/carbonado/gen/CommonMethodNames.html" title="class in com.amazon.carbonado.gen"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/amazon/carbonado/gen/CodeBuilderUtil.html" target="_top">Frames</a></li>
<li><a href="CodeBuilderUtil.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.amazon.carbonado.gen</div>
<h2 title="Class CodeBuilderUtil" class="title">Class CodeBuilderUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.amazon.carbonado.gen.CodeBuilderUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">CodeBuilderUtil</span>
extends java.lang.Object</pre>
<div class="block">Collection of useful utilities for generating Carbonado code.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.2</dd>
<dt><span class="strong">Author:</span></dt>
  <dd>Don Schneider, Brian S O'Neill</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#CodeBuilderUtil()">CodeBuilderUtil</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#addEqualsCall(org.cojen.classfile.CodeBuilder, java.lang.String, org.cojen.classfile.TypeDesc, boolean, org.cojen.classfile.Label, org.cojen.classfile.LocalVariable)">addEqualsCall</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
             java.lang.String&nbsp;fieldName,
             org.cojen.classfile.TypeDesc&nbsp;fieldType,
             boolean&nbsp;testForNull,
             org.cojen.classfile.Label&nbsp;fail,
             org.cojen.classfile.LocalVariable&nbsp;other)</code>
<div class="block">Generates code to compare a field in this object against the same one in a
 different instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#addValueHashCodeCall(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, boolean, boolean)">addValueHashCodeCall</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
                    org.cojen.classfile.TypeDesc&nbsp;valueType,
                    boolean&nbsp;testForNull,
                    boolean&nbsp;mixIn)</code>
<div class="block">Generates code to compute a hashcode for a value on the stack, consuming
 the value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#addValuesEqualCall(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, boolean, org.cojen.classfile.Label, boolean)">addValuesEqualCall</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
                  org.cojen.classfile.TypeDesc&nbsp;valueType,
                  boolean&nbsp;testForNull,
                  org.cojen.classfile.Label&nbsp;label,
                  boolean&nbsp;choice)</code>
<div class="block">Generates code to compare two values on the stack, and branch to the
 provided Label if they are not equal.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#assertParameterNotNull(org.cojen.classfile.CodeBuilder, int)">assertParameterNotNull</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
                      int&nbsp;paramIndex)</code>
<div class="block">Generate code to throw an exception if a parameter is null</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static org.cojen.classfile.TypeDesc</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#bindQueryParam(java.lang.Class)">bindQueryParam</a></strong>(java.lang.Class&nbsp;clazz)</code>
<div class="block">Determines which overloaded "with" method on Query should be bound to.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#blankValue(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc)">blankValue</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
          org.cojen.classfile.TypeDesc&nbsp;type)</code>
<div class="block">Generates code to push a blank value to the stack.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#callStringBuilderAppendChar(org.cojen.classfile.CodeBuilder)">callStringBuilderAppendChar</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b)</code>
<div class="block">Appends a char to a StringBuilder.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#callStringBuilderAppendString(org.cojen.classfile.CodeBuilder)">callStringBuilderAppendString</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b)</code>
<div class="block">Appends a String to a StringBuilder.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#callStringBuilderLength(org.cojen.classfile.CodeBuilder)">callStringBuilderLength</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b)</code>
<div class="block">Calls length on a StringBuilder on the stack, leaving an int on the stack.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#callStringBuilderSetLength(org.cojen.classfile.CodeBuilder)">callStringBuilderSetLength</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b)</code>
<div class="block">Calls setLength on a StringBuilder.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#callStringBuilderToString(org.cojen.classfile.CodeBuilder)">callStringBuilderToString</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b)</code>
<div class="block">Calls toString on a StringBuilder.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#convertValue(org.cojen.classfile.CodeBuilder, java.lang.Class, java.lang.Class)">convertValue</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
            java.lang.Class&nbsp;from,
            java.lang.Class&nbsp;to)</code>
<div class="block">Converts a value on the stack.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;S extends <a href="../../../../com/amazon/carbonado/Storable.html" title="interface in com.amazon.carbonado">Storable</a>&gt;&nbsp;<br>org.cojen.classfile.ClassFile</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#createStorableClassFile(org.cojen.util.ClassInjector, java.lang.Class, boolean, java.lang.String)">createStorableClassFile</a></strong>(org.cojen.util.ClassInjector&nbsp;ci,
                       java.lang.Class&lt;S&gt;&nbsp;type,
                       boolean&nbsp;isAbstract,
                       java.lang.String&nbsp;aSourcefileName)</code>
<div class="block">Define a classfile appropriate for most Storables.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#defineCopyBridges(org.cojen.classfile.ClassFile, java.lang.Class)">defineCopyBridges</a></strong>(org.cojen.classfile.ClassFile&nbsp;cf,
                 java.lang.Class&nbsp;leaf)</code>
<div class="block">Add copy bridge methods for all classes/interfaces between the leaf
 (genericised class) and the root (genericised baseclass).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#definePrepareBridges(org.cojen.classfile.ClassFile, java.lang.Class)">definePrepareBridges</a></strong>(org.cojen.classfile.ClassFile&nbsp;cf,
                    java.lang.Class&nbsp;leaf)</code>
<div class="block">Add prepare bridge methods for all classes/interfaces between the leaf
 (genericised class) and the root (genericised baseclass).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#definePrepareMethod(org.cojen.classfile.ClassFile, java.lang.Class, org.cojen.classfile.TypeDesc)">definePrepareMethod</a></strong>(org.cojen.classfile.ClassFile&nbsp;cf,
                   java.lang.Class&nbsp;storableClass,
                   org.cojen.classfile.TypeDesc&nbsp;supportCtorType)</code>
<div class="block">Defines a Storable prepare method, which assumes that a support field
 exists and a single-argument constructor exists which accepts a support
 instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#definePrepareMethod(org.cojen.classfile.ClassFile, java.lang.Class, org.cojen.classfile.TypeDesc, java.lang.String, org.cojen.classfile.TypeDesc)">definePrepareMethod</a></strong>(org.cojen.classfile.ClassFile&nbsp;cf,
                   java.lang.Class&nbsp;storableClass,
                   org.cojen.classfile.TypeDesc&nbsp;supportCtorType,
                   java.lang.String&nbsp;supportFieldName,
                   org.cojen.classfile.TypeDesc&nbsp;supportFieldType)</code>
<div class="block">Defines a Storable prepare method, which assumes that a support field
 exists and a single-argument constructor exists which accepts a support
 instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.util.Set&lt;java.lang.Class&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#gatherAllBridgeTypes(java.util.Set, java.lang.Class)">gatherAllBridgeTypes</a></strong>(java.util.Set&lt;java.lang.Class&gt;&nbsp;set,
                    java.lang.Class&nbsp;leaf)</code>
<div class="block">Collect a set of all the interfaces and recursively all superclasses for the leaf
 (genericised class) and root (genericised base class).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#incrementVersion(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc)">incrementVersion</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
                org.cojen.classfile.TypeDesc&nbsp;type)</code>
<div class="block">Generates code to increment a version property value, already on the stack.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#initialVersion(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, int)">initialVersion</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
              org.cojen.classfile.TypeDesc&nbsp;type,
              int&nbsp;value)</code>
<div class="block">Generates code to push an initial version property value on the stack.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#isPublicMethodFinal(java.lang.Class, java.lang.String, org.cojen.classfile.TypeDesc, org.cojen.classfile.TypeDesc[])">isPublicMethodFinal</a></strong>(java.lang.Class&nbsp;clazz,
                   java.lang.String&nbsp;name,
                   org.cojen.classfile.TypeDesc&nbsp;retType,
                   org.cojen.classfile.TypeDesc[]&nbsp;params)</code>
<div class="block">Returns true if a public final method exists which matches the given
 specification.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#throwConcatException(org.cojen.classfile.CodeBuilder, java.lang.Class, java.lang.String...)">throwConcatException</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
                    java.lang.Class&nbsp;type,
                    java.lang.String...&nbsp;messages)</code>
<div class="block">Generate code to throw an exception with a message concatenated at runtime.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#throwException(org.cojen.classfile.CodeBuilder, java.lang.Class, java.lang.String)">throwException</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
              java.lang.Class&nbsp;type,
              java.lang.String&nbsp;message)</code>
<div class="block">Generate code to throw an exception with an optional message.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static org.cojen.classfile.LocalVariable</code></td>
<td class="colLast"><code><strong><a href="../../../../com/amazon/carbonado/gen/CodeBuilderUtil.html#uneraseGenericParameter(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, int)">uneraseGenericParameter</a></strong>(org.cojen.classfile.CodeBuilder&nbsp;b,
                       org.cojen.classfile.TypeDesc&nbsp;paramType,
                       int&nbsp;paramIndex)</code>
<div class="block">Generate code to create a local variable containing the specified parameter coerced
 to the specified type.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="CodeBuilderUtil()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CodeBuilderUtil</h4>
<pre>public&nbsp;CodeBuilderUtil()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="assertParameterNotNull(org.cojen.classfile.CodeBuilder, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assertParameterNotNull</h4>
<pre>public static&nbsp;void&nbsp;assertParameterNotNull(org.cojen.classfile.CodeBuilder&nbsp;b,
                          int&nbsp;paramIndex)</pre>
<div class="block">Generate code to throw an exception if a parameter is null</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - CodeBuilder into which to append the code</dd><dd><code>paramIndex</code> - index of the parameter to check</dd></dl>
</li>
</ul>
<a name="uneraseGenericParameter(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>uneraseGenericParameter</h4>
<pre>public static&nbsp;org.cojen.classfile.LocalVariable&nbsp;uneraseGenericParameter(org.cojen.classfile.CodeBuilder&nbsp;b,
                                                        org.cojen.classfile.TypeDesc&nbsp;paramType,
                                                        int&nbsp;paramIndex)</pre>
<div class="block">Generate code to create a local variable containing the specified parameter coerced
 to the specified type.  This is useful for re-interpreting erased generics into
 the more specific genericized type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - CodeBuilder into which to append the code</dd><dd><code>paramType</code> - the more specific type which was erased during compilation</dd><dd><code>paramIndex</code> - index of the parameter to unerase</dd>
<dt><span class="strong">Returns:</span></dt><dd>a local variable referencing the type-cast parameter</dd></dl>
</li>
</ul>
<a name="throwException(org.cojen.classfile.CodeBuilder, java.lang.Class, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>throwException</h4>
<pre>public static&nbsp;void&nbsp;throwException(org.cojen.classfile.CodeBuilder&nbsp;b,
                  java.lang.Class&nbsp;type,
                  java.lang.String&nbsp;message)</pre>
<div class="block">Generate code to throw an exception with an optional message.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - <code>CodeBuilder</code> to which to add code</dd><dd><code>type</code> - type of the object to throw</dd><dd><code>message</code> - optional message to provide to the constructor</dd></dl>
</li>
</ul>
<a name="throwConcatException(org.cojen.classfile.CodeBuilder, java.lang.Class, java.lang.String...)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>throwConcatException</h4>
<pre>public static&nbsp;void&nbsp;throwConcatException(org.cojen.classfile.CodeBuilder&nbsp;b,
                        java.lang.Class&nbsp;type,
                        java.lang.String...&nbsp;messages)</pre>
<div class="block">Generate code to throw an exception with a message concatenated at runtime.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - <code>CodeBuilder</code> to which to add code</dd><dd><code>type</code> - type of the object to throw</dd><dd><code>messages</code> - messages to concat at runtime</dd></dl>
</li>
</ul>
<a name="gatherAllBridgeTypes(java.util.Set, java.lang.Class)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>gatherAllBridgeTypes</h4>
<pre>public static&nbsp;java.util.Set&lt;java.lang.Class&gt;&nbsp;gatherAllBridgeTypes(java.util.Set&lt;java.lang.Class&gt;&nbsp;set,
                                                  java.lang.Class&nbsp;leaf)</pre>
<div class="block">Collect a set of all the interfaces and recursively all superclasses for the leaf
 (genericised class) and root (genericised base class).  Eg, for Object<foo>, all
 classes and implemented interfaces for every superclass between foo (the leaf) and
 Object (the base).
 <P>A copy must be coercible into any of these types, and copy bridge methods must be
 provided to do so.

 <P>Note that the official documentation for this is in draft form, and you have to be
 psychic to have figured out the necessity in the first place.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>set</code> - set into which the class types will be collected</dd><dd><code>leaf</code> - leaf class</dd>
<dt><span class="strong">Returns:</span></dt><dd>same set as was passed in</dd></dl>
</li>
</ul>
<a name="defineCopyBridges(org.cojen.classfile.ClassFile, java.lang.Class)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>defineCopyBridges</h4>
<pre>public static&nbsp;void&nbsp;defineCopyBridges(org.cojen.classfile.ClassFile&nbsp;cf,
                     java.lang.Class&nbsp;leaf)</pre>
<div class="block">Add copy bridge methods for all classes/interfaces between the leaf
 (genericised class) and the root (genericised baseclass).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cf</code> - file to which to add the copy bridge</dd><dd><code>leaf</code> - leaf class</dd></dl>
</li>
</ul>
<a name="definePrepareMethod(org.cojen.classfile.ClassFile, java.lang.Class, org.cojen.classfile.TypeDesc)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>definePrepareMethod</h4>
<pre>public static&nbsp;void&nbsp;definePrepareMethod(org.cojen.classfile.ClassFile&nbsp;cf,
                       java.lang.Class&nbsp;storableClass,
                       org.cojen.classfile.TypeDesc&nbsp;supportCtorType)</pre>
<div class="block">Defines a Storable prepare method, which assumes that a support field
 exists and a single-argument constructor exists which accepts a support
 instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cf</code> - file to which to add the prepare method</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.2</dd></dl>
</li>
</ul>
<a name="definePrepareMethod(org.cojen.classfile.ClassFile, java.lang.Class, org.cojen.classfile.TypeDesc, java.lang.String, org.cojen.classfile.TypeDesc)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>definePrepareMethod</h4>
<pre>public static&nbsp;void&nbsp;definePrepareMethod(org.cojen.classfile.ClassFile&nbsp;cf,
                       java.lang.Class&nbsp;storableClass,
                       org.cojen.classfile.TypeDesc&nbsp;supportCtorType,
                       java.lang.String&nbsp;supportFieldName,
                       org.cojen.classfile.TypeDesc&nbsp;supportFieldType)</pre>
<div class="block">Defines a Storable prepare method, which assumes that a support field
 exists and a single-argument constructor exists which accepts a support
 instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cf</code> - file to which to add the prepare method</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.2</dd></dl>
</li>
</ul>
<a name="definePrepareBridges(org.cojen.classfile.ClassFile, java.lang.Class)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>definePrepareBridges</h4>
<pre>public static&nbsp;void&nbsp;definePrepareBridges(org.cojen.classfile.ClassFile&nbsp;cf,
                        java.lang.Class&nbsp;leaf)</pre>
<div class="block">Add prepare bridge methods for all classes/interfaces between the leaf
 (genericised class) and the root (genericised baseclass).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cf</code> - file to which to add the prepare bridge</dd><dd><code>leaf</code> - leaf class</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.2</dd></dl>
</li>
</ul>
<a name="isPublicMethodFinal(java.lang.Class, java.lang.String, org.cojen.classfile.TypeDesc, org.cojen.classfile.TypeDesc[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isPublicMethodFinal</h4>
<pre>public static&nbsp;boolean&nbsp;isPublicMethodFinal(java.lang.Class&nbsp;clazz,
                          java.lang.String&nbsp;name,
                          org.cojen.classfile.TypeDesc&nbsp;retType,
                          org.cojen.classfile.TypeDesc[]&nbsp;params)</pre>
<div class="block">Returns true if a public final method exists which matches the given
 specification.</div>
</li>
</ul>
<a name="createStorableClassFile(org.cojen.util.ClassInjector, java.lang.Class, boolean, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createStorableClassFile</h4>
<pre>public static&nbsp;&lt;S extends <a href="../../../../com/amazon/carbonado/Storable.html" title="interface in com.amazon.carbonado">Storable</a>&gt;&nbsp;org.cojen.classfile.ClassFile&nbsp;createStorableClassFile(org.cojen.util.ClassInjector&nbsp;ci,
                                                                         java.lang.Class&lt;S&gt;&nbsp;type,
                                                                         boolean&nbsp;isAbstract,
                                                                         java.lang.String&nbsp;aSourcefileName)</pre>
<div class="block">Define a classfile appropriate for most Storables.  Specifically:
 <ul>
 <li>implements Storable</li>
 <li>implements Cloneable
 <li>abstract if appropriate
 <li>marked synthetic
 <li>targetted for java version 1.5
 </ul></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>ci</code> - ClassInjector for the storable</dd><dd><code>type</code> - specific Storable implementation to generate</dd><dd><code>isAbstract</code> - true if the class should be abstract</dd><dd><code>aSourcefileName</code> - identifier for the classfile, typically the factory class name</dd>
<dt><span class="strong">Returns:</span></dt><dd>ClassFile object ready to have methods added.</dd></dl>
</li>
</ul>
<a name="addValueHashCodeCall(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, boolean, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addValueHashCodeCall</h4>
<pre>public static&nbsp;void&nbsp;addValueHashCodeCall(org.cojen.classfile.CodeBuilder&nbsp;b,
                        org.cojen.classfile.TypeDesc&nbsp;valueType,
                        boolean&nbsp;testForNull,
                        boolean&nbsp;mixIn)</pre>
<div class="block">Generates code to compute a hashcode for a value on the stack, consuming
 the value. After the code executes, the stack contains an int hashcode.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - <code>CodeBuilder</code> to which to add the code</dd><dd><code>valueType</code> - the type of the value</dd><dd><code>testForNull</code> - if true and the value is a reference and might be null</dd><dd><code>mixIn</code> - if true, stack has an existing hashcode followed by a value</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.2.2</dd></dl>
</li>
</ul>
<a name="addEqualsCall(org.cojen.classfile.CodeBuilder, java.lang.String, org.cojen.classfile.TypeDesc, boolean, org.cojen.classfile.Label, org.cojen.classfile.LocalVariable)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addEqualsCall</h4>
<pre>public static&nbsp;void&nbsp;addEqualsCall(org.cojen.classfile.CodeBuilder&nbsp;b,
                 java.lang.String&nbsp;fieldName,
                 org.cojen.classfile.TypeDesc&nbsp;fieldType,
                 boolean&nbsp;testForNull,
                 org.cojen.classfile.Label&nbsp;fail,
                 org.cojen.classfile.LocalVariable&nbsp;other)</pre>
<div class="block">Generates code to compare a field in this object against the same one in a
 different instance. Branch to the provided Label if they are not equal.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - <code>CodeBuilder</code> to which to add the code</dd><dd><code>fieldName</code> - the name of the field</dd><dd><code>fieldType</code> - the type of the field</dd><dd><code>testForNull</code> - if true and the values are references, they will be considered
 unequal unless neither or both are null.  If false, assume neither is null.</dd><dd><code>fail</code> - the label to branch to</dd><dd><code>other</code> - the other instance to test</dd></dl>
</li>
</ul>
<a name="addValuesEqualCall(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, boolean, org.cojen.classfile.Label, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addValuesEqualCall</h4>
<pre>public static&nbsp;void&nbsp;addValuesEqualCall(org.cojen.classfile.CodeBuilder&nbsp;b,
                      org.cojen.classfile.TypeDesc&nbsp;valueType,
                      boolean&nbsp;testForNull,
                      org.cojen.classfile.Label&nbsp;label,
                      boolean&nbsp;choice)</pre>
<div class="block">Generates code to compare two values on the stack, and branch to the
 provided Label if they are not equal.  Both values must be of the same
 type. If they are floating point values, NaN is considered equal to NaN,
 which is inconsistent with the usual treatment for NaN.

 <P>The generated instruction consumes both values on the stack.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - <code>CodeBuilder</code> to which to add the code</dd><dd><code>valueType</code> - the type of the values</dd><dd><code>testForNull</code> - if true and the values are references, they will be considered
 unequal unless neither or both are null.  If false, assume neither is null.</dd><dd><code>label</code> - the label to branch to</dd><dd><code>choice</code> - when true, branch to label if values are equal, else
 branch to label if values are unequal.</dd></dl>
</li>
</ul>
<a name="convertValue(org.cojen.classfile.CodeBuilder, java.lang.Class, java.lang.Class)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>convertValue</h4>
<pre>public static&nbsp;void&nbsp;convertValue(org.cojen.classfile.CodeBuilder&nbsp;b,
                java.lang.Class&nbsp;from,
                java.lang.Class&nbsp;to)</pre>
<div class="block">Converts a value on the stack. If "to" type is a String, then conversion
 may call the String.valueOf(from).</div>
</li>
</ul>
<a name="initialVersion(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialVersion</h4>
<pre>public static&nbsp;void&nbsp;initialVersion(org.cojen.classfile.CodeBuilder&nbsp;b,
                  org.cojen.classfile.TypeDesc&nbsp;type,
                  int&nbsp;value)
                           throws <a href="../../../../com/amazon/carbonado/SupportException.html" title="class in com.amazon.carbonado">SupportException</a></pre>
<div class="block">Generates code to push an initial version property value on the stack.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/amazon/carbonado/SupportException.html" title="class in com.amazon.carbonado">SupportException</a></code> - if version type is not supported</dd></dl>
</li>
</ul>
<a name="incrementVersion(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>incrementVersion</h4>
<pre>public static&nbsp;void&nbsp;incrementVersion(org.cojen.classfile.CodeBuilder&nbsp;b,
                    org.cojen.classfile.TypeDesc&nbsp;type)
                             throws <a href="../../../../com/amazon/carbonado/SupportException.html" title="class in com.amazon.carbonado">SupportException</a></pre>
<div class="block">Generates code to increment a version property value, already on the stack.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/amazon/carbonado/SupportException.html" title="class in com.amazon.carbonado">SupportException</a></code> - if version type is not supported</dd></dl>
</li>
</ul>
<a name="blankValue(org.cojen.classfile.CodeBuilder, org.cojen.classfile.TypeDesc)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>blankValue</h4>
<pre>public static&nbsp;void&nbsp;blankValue(org.cojen.classfile.CodeBuilder&nbsp;b,
              org.cojen.classfile.TypeDesc&nbsp;type)</pre>
<div class="block">Generates code to push a blank value to the stack. For objects, it is
 null, and for primitive types it is zero or false.</div>
</li>
</ul>
<a name="bindQueryParam(java.lang.Class)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bindQueryParam</h4>
<pre>public static&nbsp;org.cojen.classfile.TypeDesc&nbsp;bindQueryParam(java.lang.Class&nbsp;clazz)</pre>
<div class="block">Determines which overloaded "with" method on Query should be bound to.</div>
</li>
</ul>
<a name="callStringBuilderAppendString(org.cojen.classfile.CodeBuilder)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>callStringBuilderAppendString</h4>
<pre>public static&nbsp;void&nbsp;callStringBuilderAppendString(org.cojen.classfile.CodeBuilder&nbsp;b)</pre>
<div class="block">Appends a String to a StringBuilder. A StringBuilder and String must be
 on the stack, and a StringBuilder is left on the stack after the call.</div>
</li>
</ul>
<a name="callStringBuilderAppendChar(org.cojen.classfile.CodeBuilder)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>callStringBuilderAppendChar</h4>
<pre>public static&nbsp;void&nbsp;callStringBuilderAppendChar(org.cojen.classfile.CodeBuilder&nbsp;b)</pre>
<div class="block">Appends a char to a StringBuilder. A StringBuilder and char must be on
 the stack, and a StringBuilder is left on the stack after the call.</div>
</li>
</ul>
<a name="callStringBuilderLength(org.cojen.classfile.CodeBuilder)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>callStringBuilderLength</h4>
<pre>public static&nbsp;void&nbsp;callStringBuilderLength(org.cojen.classfile.CodeBuilder&nbsp;b)</pre>
<div class="block">Calls length on a StringBuilder on the stack, leaving an int on the stack.</div>
</li>
</ul>
<a name="callStringBuilderSetLength(org.cojen.classfile.CodeBuilder)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>callStringBuilderSetLength</h4>
<pre>public static&nbsp;void&nbsp;callStringBuilderSetLength(org.cojen.classfile.CodeBuilder&nbsp;b)</pre>
<div class="block">Calls setLength on a StringBuilder. A StringBuilder and int must be on
 the stack, and both are consumed after the call.</div>
</li>
</ul>
<a name="callStringBuilderToString(org.cojen.classfile.CodeBuilder)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>callStringBuilderToString</h4>
<pre>public static&nbsp;void&nbsp;callStringBuilderToString(org.cojen.classfile.CodeBuilder&nbsp;b)</pre>
<div class="block">Calls toString on a StringBuilder. A StringBuilder must be on the stack,
 and a String is left on the stack after the call.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CodeBuilderUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../com/amazon/carbonado/gen/CommonMethodNames.html" title="class in com.amazon.carbonado.gen"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/amazon/carbonado/gen/CodeBuilderUtil.html" target="_top">Frames</a></li>
<li><a href="CodeBuilderUtil.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2006-2013 <a href="https://github.com/Carbonado/Carbonado">Amazon Technologies, Inc.</a>. All Rights Reserved.</small></p>
</body>
</html>