aboutsummaryrefslogtreecommitdiffstats
path: root/html/javassist/CtConstructor.html
blob: 2f8f5fee7f790e9a2bddb3157335917a5f5e4bfc (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
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.1) on Tue Apr 16 01:48:29 JST 2019 -->
<title>CtConstructor (Javassist API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2019-04-16">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
<script type="text/javascript" src="../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="CtConstructor (Javassist API)";
        }
    }
    catch(err) {
    }
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CtConstructor.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-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">javassist</a></div>
<h2 title="Class CtConstructor" class="title">Class CtConstructor</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="CtMember.html" title="class in javassist">javassist.CtMember</a></li>
<li>
<ul class="inheritance">
<li><a href="CtBehavior.html" title="class in javassist">javassist.CtBehavior</a></li>
<li>
<ul class="inheritance">
<li>javassist.CtConstructor</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public final class <span class="typeNameLabel">CtConstructor</span>
extends <a href="CtBehavior.html" title="class in javassist">CtBehavior</a></pre>
<div class="block">An instance of CtConstructor represents a constructor.
 It may represent a static constructor
 (class initializer).  To distinguish a constructor and a class
 initializer, call <code>isClassInitializer()</code>.

 <p>See the super class <code>CtBehavior</code> as well since
 a number of useful methods are in <code>CtBehavior</code>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="CtClass.html#getDeclaredConstructors()"><code>CtClass.getDeclaredConstructors()</code></a>, 
<a href="CtClass.html#getClassInitializer()"><code>CtClass.getClassInitializer()</code></a>, 
<a href="CtNewConstructor.html" title="class in javassist"><code>CtNewConstructor</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(javassist.CtClass%5B%5D,javassist.CtClass)">CtConstructor</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>[]&nbsp;parameters,
             <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring)</code></th>
<td class="colLast">
<div class="block">Creates a constructor with no constructor body.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(javassist.CtConstructor,javassist.CtClass,javassist.ClassMap)">CtConstructor</a></span>&#8203;(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a>&nbsp;src,
             <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring,
             <a href="ClassMap.html" title="class in javassist">ClassMap</a>&nbsp;map)</code></th>
<td class="colLast">
<div class="block">Creates a copy of a <code>CtConstructor</code> object.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#callsSuper()">callsSuper</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns true if this constructor calls a constructor
 of the super class.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLongName()">getLongName</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the constructor name followed by parameter types
 such as <code>javassist.CtConstructor(CtClass[],CtClass)</code>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getName()">getName</a></span>()</code></th>
<td class="colLast">
<div class="block">Obtains the name of this constructor.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#insertBeforeBody(java.lang.String)">insertBeforeBody</a></span>&#8203;(java.lang.String&nbsp;src)</code></th>
<td class="colLast">
<div class="block">Inserts bytecode just after another constructor in the super class
 or this class is called.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isClassInitializer()">isClassInitializer</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns true if this object represents a static initializer.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isConstructor()">isConstructor</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns true if this object represents a constructor.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEmpty()">isEmpty</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns true if the constructor (or static initializer)
 is the default one.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBody(java.lang.String)">setBody</a></span>&#8203;(java.lang.String&nbsp;src)</code></th>
<td class="colLast">
<div class="block">Sets a constructor body.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBody(javassist.CtConstructor,javassist.ClassMap)">setBody</a></span>&#8203;(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a>&nbsp;src,
       <a href="ClassMap.html" title="class in javassist">ClassMap</a>&nbsp;map)</code></th>
<td class="colLast">
<div class="block">Copies a constructor body from another constructor.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="CtMethod.html" title="class in javassist">CtMethod</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toMethod(java.lang.String,javassist.CtClass)">toMethod</a></span>&#8203;(java.lang.String&nbsp;name,
        <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring)</code></th>
<td class="colLast">
<div class="block">Makes a copy of this constructor and converts it into a method.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="CtMethod.html" title="class in javassist">CtMethod</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toMethod(java.lang.String,javassist.CtClass,javassist.ClassMap)">toMethod</a></span>&#8203;(java.lang.String&nbsp;name,
        <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring,
        <a href="ClassMap.html" title="class in javassist">ClassMap</a>&nbsp;map)</code></th>
<td class="colLast">
<div class="block">Makes a copy of this constructor and converts it into a method.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.javassist.CtBehavior">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;javassist.<a href="CtBehavior.html" title="class in javassist">CtBehavior</a></h3>
<code><a href="CtBehavior.html#addCatch(java.lang.String,javassist.CtClass)">addCatch</a>, <a href="CtBehavior.html#addCatch(java.lang.String,javassist.CtClass,java.lang.String)">addCatch</a>, <a href="CtBehavior.html#addLocalVariable(java.lang.String,javassist.CtClass)">addLocalVariable</a>, <a href="CtBehavior.html#addParameter(javassist.CtClass)">addParameter</a>, <a href="CtBehavior.html#getAnnotation(java.lang.Class)">getAnnotation</a>, <a href="CtBehavior.html#getAnnotations()">getAnnotations</a>, <a href="CtBehavior.html#getAttribute(java.lang.String)">getAttribute</a>, <a href="CtBehavior.html#getAvailableAnnotations()">getAvailableAnnotations</a>, <a href="CtBehavior.html#getAvailableParameterAnnotations()">getAvailableParameterAnnotations</a>, <a href="CtBehavior.html#getExceptionTypes()">getExceptionTypes</a>, <a href="CtBehavior.html#getGenericSignature()">getGenericSignature</a>, <a href="CtBehavior.html#getMethodInfo()">getMethodInfo</a>, <a href="CtBehavior.html#getMethodInfo2()">getMethodInfo2</a>, <a href="CtBehavior.html#getModifiers()">getModifiers</a>, <a href="CtBehavior.html#getParameterAnnotations()">getParameterAnnotations</a>, <a href="CtBehavior.html#getParameterTypes()">getParameterTypes</a>, <a href="CtBehavior.html#getSignature()">getSignature</a>, <a href="CtBehavior.html#hasAnnotation(java.lang.String)">hasAnnotation</a>, <a href="CtBehavior.html#insertAfter(java.lang.String)">insertAfter</a>, <a href="CtBehavior.html#insertAfter(java.lang.String,boolean)">insertAfter</a>, <a href="CtBehavior.html#insertAt(int,boolean,java.lang.String)">insertAt</a>, <a href="CtBehavior.html#insertAt(int,java.lang.String)">insertAt</a>, <a href="CtBehavior.html#insertBefore(java.lang.String)">insertBefore</a>, <a href="CtBehavior.html#insertParameter(javassist.CtClass)">insertParameter</a>, <a href="CtBehavior.html#instrument(javassist.CodeConverter)">instrument</a>, <a href="CtBehavior.html#instrument(javassist.expr.ExprEditor)">instrument</a>, <a href="CtBehavior.html#setAttribute(java.lang.String,byte%5B%5D)">setAttribute</a>, <a href="CtBehavior.html#setBody(java.lang.String,java.lang.String,java.lang.String)">setBody</a>, <a href="CtBehavior.html#setExceptionTypes(javassist.CtClass%5B%5D)">setExceptionTypes</a>, <a href="CtBehavior.html#setGenericSignature(java.lang.String)">setGenericSignature</a>, <a href="CtBehavior.html#setModifiers(int)">setModifiers</a>, <a href="CtBehavior.html#useCflow(java.lang.String)">useCflow</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.javassist.CtMember">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;javassist.<a href="CtMember.html" title="class in javassist">CtMember</a></h3>
<code><a href="CtMember.html#getDeclaringClass()">getDeclaringClass</a>, <a href="CtMember.html#hasAnnotation(java.lang.Class)">hasAnnotation</a>, <a href="CtMember.html#toString()">toString</a>, <a href="CtMember.html#visibleFrom(javassist.CtClass)">visibleFrom</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;(javassist.CtClass[],javassist.CtClass)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CtConstructor</h4>
<pre>public&nbsp;CtConstructor&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>[]&nbsp;parameters,
                     <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring)</pre>
<div class="block">Creates a constructor with no constructor body.
 The created constructor
 must be added to a class with <code>CtClass.addConstructor()</code>.

 <p>The created constructor does not include a constructor body,
 which must be specified with <code>setBody()</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>declaring</code> - the class to which the created method is added.</dd>
<dd><code>parameters</code> - a list of the parameter types</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="CtClass.html#addConstructor(javassist.CtConstructor)"><code>CtClass.addConstructor(CtConstructor)</code></a>, 
<a href="#setBody(java.lang.String)"><code>setBody(String)</code></a>, 
<a href="#setBody(javassist.CtConstructor,javassist.ClassMap)"><code>setBody(CtConstructor,ClassMap)</code></a></dd>
</dl>
</li>
</ul>
<a id="&lt;init&gt;(javassist.CtConstructor,javassist.CtClass,javassist.ClassMap)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CtConstructor</h4>
<pre>public&nbsp;CtConstructor&#8203;(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a>&nbsp;src,
                     <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring,
                     <a href="ClassMap.html" title="class in javassist">ClassMap</a>&nbsp;map)
              throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
<div class="block">Creates a copy of a <code>CtConstructor</code> object.
 The created constructor must be
 added to a class with <code>CtClass.addConstructor()</code>.

 <p>All occurrences of class names in the created constructor
 are replaced with names specified by
 <code>map</code> if <code>map</code> is not <code>null</code>.

 <p>By default, all the occurrences of the names of the class
 declaring <code>src</code> and the superclass are replaced
 with the name of the class and the superclass that
 the created constructor is added to.
 This is done whichever <code>map</code> is null or not.
 To prevent this replacement, call <code>ClassMap.fix()</code>
 or <code>put()</code> to explicitly specify replacement.

 <p><b>Note:</b> if the <code>.class</code> notation (for example,
 <code>String.class</code>) is included in an expression, the
 Javac compiler may produce a helper method.
 Since this constructor never
 copies this helper method, the programmers have the responsiblity of
 copying it.  Otherwise, use <code>Class.forName()</code> in the
 expression.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>src</code> - the source method.</dd>
<dd><code>declaring</code> - the class to which the created method is added.</dd>
<dd><code>map</code> - the hashtable associating original class names
                  with substituted names.
                  It can be <code>null</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="CtClass.html#addConstructor(javassist.CtConstructor)"><code>CtClass.addConstructor(CtConstructor)</code></a>, 
<a href="ClassMap.html#fix(java.lang.String)"><code>ClassMap.fix(String)</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a id="isConstructor()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isConstructor</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isConstructor()</pre>
<div class="block">Returns true if this object represents a constructor.</div>
</li>
</ul>
<a id="isClassInitializer()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isClassInitializer</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isClassInitializer()</pre>
<div class="block">Returns true if this object represents a static initializer.</div>
</li>
</ul>
<a id="getLongName()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLongName</h4>
<pre class="methodSignature">public&nbsp;java.lang.String&nbsp;getLongName()</pre>
<div class="block">Returns the constructor name followed by parameter types
 such as <code>javassist.CtConstructor(CtClass[],CtClass)</code>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="CtBehavior.html#getLongName()">getLongName</a></code>&nbsp;in class&nbsp;<code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a></code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>3.5</dd>
</dl>
</li>
</ul>
<a id="getName()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre class="methodSignature">public&nbsp;java.lang.String&nbsp;getName()</pre>
<div class="block">Obtains the name of this constructor.
 It is the same as the simple name of the class declaring this
 constructor.  If this object represents a class initializer,
 then this method returns <code>"&lt;clinit&gt;"</code>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="CtMember.html#getName()">getName</a></code>&nbsp;in class&nbsp;<code><a href="CtMember.html" title="class in javassist">CtMember</a></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getName()"><code>getName()</code></a></dd>
</dl>
</li>
</ul>
<a id="isEmpty()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isEmpty()</pre>
<div class="block">Returns true if the constructor (or static initializer)
 is the default one.  This method returns true if the constructor
 takes some arguments but it does not perform anything except
 calling <code>super()</code> (the no-argument constructor of
 the super class).</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="CtBehavior.html#isEmpty()">isEmpty</a></code>&nbsp;in class&nbsp;<code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a></code></dd>
</dl>
</li>
</ul>
<a id="callsSuper()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>callsSuper</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;callsSuper()
                   throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
<div class="block">Returns true if this constructor calls a constructor
 of the super class.  This method returns false if it
 calls another constructor of this class by <code>this()</code>.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
</dl>
</li>
</ul>
<a id="setBody(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBody</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setBody&#8203;(java.lang.String&nbsp;src)
             throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
<div class="block">Sets a constructor body.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="CtBehavior.html#setBody(java.lang.String)">setBody</a></code>&nbsp;in class&nbsp;<code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>src</code> - the source code representing the constructor body.
                  It must be a single statement or block.
                  If it is <code>null</code>, the substituted
                  constructor body does nothing except calling
                  <code>super()</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
</dl>
</li>
</ul>
<a id="setBody(javassist.CtConstructor,javassist.ClassMap)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBody</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setBody&#8203;(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a>&nbsp;src,
                    <a href="ClassMap.html" title="class in javassist">ClassMap</a>&nbsp;map)
             throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
<div class="block">Copies a constructor body from another constructor.

 <p>All occurrences of the class names in the copied body
 are replaced with the names specified by
 <code>map</code> if <code>map</code> is not <code>null</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>src</code> - the method that the body is copied from.</dd>
<dd><code>map</code> - the hashtable associating original class names
                  with substituted names.
                  It can be <code>null</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
</dl>
</li>
</ul>
<a id="insertBeforeBody(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>insertBeforeBody</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;insertBeforeBody&#8203;(java.lang.String&nbsp;src)
                      throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
<div class="block">Inserts bytecode just after another constructor in the super class
 or this class is called.
 It does not work if this object represents a class initializer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>src</code> - the source code representing the inserted bytecode.
                  It must be a single statement or block.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
</dl>
</li>
</ul>
<a id="toMethod(java.lang.String,javassist.CtClass)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toMethod</h4>
<pre class="methodSignature">public&nbsp;<a href="CtMethod.html" title="class in javassist">CtMethod</a>&nbsp;toMethod&#8203;(java.lang.String&nbsp;name,
                         <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring)
                  throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
<div class="block">Makes a copy of this constructor and converts it into a method.
 The signature of the mehtod is the same as the that of this constructor.
 The return type is <code>void</code>.  The resulting method must be
 appended to the class specified by <code>declaring</code>.
 If this constructor is a static initializer, the resulting method takes
 no parameter.

 <p>An occurrence of another constructor call <code>this()</code>
 or a super constructor call <code>super()</code> is
 eliminated from the resulting method. 

 <p>The immediate super class of the class declaring this constructor
 must be also a super class of the class declaring the resulting method.
 If the constructor accesses a field, the class declaring the resulting method
 must also declare a field with the same name and type.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the resulting method.</dd>
<dd><code>declaring</code> - the class declaring the resulting method.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
</dl>
</li>
</ul>
<a id="toMethod(java.lang.String,javassist.CtClass,javassist.ClassMap)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toMethod</h4>
<pre class="methodSignature">public&nbsp;<a href="CtMethod.html" title="class in javassist">CtMethod</a>&nbsp;toMethod&#8203;(java.lang.String&nbsp;name,
                         <a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;declaring,
                         <a href="ClassMap.html" title="class in javassist">ClassMap</a>&nbsp;map)
                  throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
<div class="block">Makes a copy of this constructor and converts it into a method.
 The signature of the method is the same as the that of this constructor.
 The return type is <code>void</code>.  The resulting method must be
 appended to the class specified by <code>declaring</code>.
 If this constructor is a static initializer, the resulting method takes
 no parameter.

 <p>An occurrence of another constructor call <code>this()</code>
 or a super constructor call <code>super()</code> is
 eliminated from the resulting method. 

 <p>The immediate super class of the class declaring this constructor
 must be also a super class of the class declaring the resulting method
 (this is obviously true if the second parameter <code>declaring</code> is
 the same as the class declaring this constructor).
 If the constructor accesses a field, the class declaring the resulting method
 must also declare a field with the same name and type.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the resulting method.</dd>
<dd><code>declaring</code> - the class declaring the resulting method.
                          It is normally the same as the class declaring this
                          constructor.</dd>
<dd><code>map</code> - the hash table associating original class names
                  with substituted names.  The original class names will be
                  replaced while making a copy.
                  <code>map</code> can be <code>null</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CtConstructor.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-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses.html">All&nbsp;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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small><i>Javassist, a Java-bytecode translator toolkit.<br>
Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.</i></small></p>
</footer>
</body>
</html>