You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CtField.Initializer.html 34KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. <!DOCTYPE HTML>
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (11) on Sat May 08 11:16:00 JST 2021 -->
  6. <title>CtField.Initializer (Javassist API)</title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta name="dc.created" content="2021-05-08">
  9. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  10. <link rel="stylesheet" type="text/css" href="../jquery/jquery-ui.css" title="Style">
  11. <script type="text/javascript" src="../script.js"></script>
  12. <script type="text/javascript" src="../jquery/jszip/dist/jszip.min.js"></script>
  13. <script type="text/javascript" src="../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
  14. <!--[if IE]>
  15. <script type="text/javascript" src="../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
  16. <![endif]-->
  17. <script type="text/javascript" src="../jquery/jquery-3.3.1.js"></script>
  18. <script type="text/javascript" src="../jquery/jquery-migrate-3.0.1.js"></script>
  19. <script type="text/javascript" src="../jquery/jquery-ui.js"></script>
  20. </head>
  21. <body>
  22. <script type="text/javascript"><!--
  23. try {
  24. if (location.href.indexOf('is-external=true') == -1) {
  25. parent.document.title="CtField.Initializer (Javassist API)";
  26. }
  27. }
  28. catch(err) {
  29. }
  30. //-->
  31. var data = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9};
  32. var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
  33. var altColor = "altColor";
  34. var rowColor = "rowColor";
  35. var tableTab = "tableTab";
  36. var activeTableTab = "activeTableTab";
  37. var pathtoroot = "../";
  38. var useModuleDirectories = true;
  39. loadScripts(document, 'script');</script>
  40. <noscript>
  41. <div>JavaScript is disabled on your browser.</div>
  42. </noscript>
  43. <header role="banner">
  44. <nav role="navigation">
  45. <div class="fixedNav">
  46. <!-- ========= START OF TOP NAVBAR ======= -->
  47. <div class="topNav"><a id="navbar.top">
  48. <!-- -->
  49. </a>
  50. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  51. <a id="navbar.top.firstrow">
  52. <!-- -->
  53. </a>
  54. <ul class="navList" title="Navigation">
  55. <li><a href="../index.html">Overview</a></li>
  56. <li><a href="package-summary.html">Package</a></li>
  57. <li class="navBarCell1Rev">Class</li>
  58. <li><a href="class-use/CtField.Initializer.html">Use</a></li>
  59. <li><a href="package-tree.html">Tree</a></li>
  60. <li><a href="../deprecated-list.html">Deprecated</a></li>
  61. <li><a href="../index-all.html">Index</a></li>
  62. </ul>
  63. </div>
  64. <div class="subNav">
  65. <ul class="navList" id="allclasses_navbar_top">
  66. <li><a href="../allclasses.html">All&nbsp;Classes</a></li>
  67. </ul>
  68. <ul class="navListSearch">
  69. <li><label for="search">SEARCH:</label>
  70. <input type="text" id="search" value="search" disabled="disabled">
  71. <input type="reset" id="reset" value="reset" disabled="disabled">
  72. </li>
  73. </ul>
  74. <div>
  75. <script type="text/javascript"><!--
  76. allClassesLink = document.getElementById("allclasses_navbar_top");
  77. if(window==top) {
  78. allClassesLink.style.display = "block";
  79. }
  80. else {
  81. allClassesLink.style.display = "none";
  82. }
  83. //-->
  84. </script>
  85. <noscript>
  86. <div>JavaScript is disabled on your browser.</div>
  87. </noscript>
  88. </div>
  89. <div>
  90. <ul class="subNavList">
  91. <li>Summary:&nbsp;</li>
  92. <li>Nested&nbsp;|&nbsp;</li>
  93. <li>Field&nbsp;|&nbsp;</li>
  94. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  95. <li><a href="#method.summary">Method</a></li>
  96. </ul>
  97. <ul class="subNavList">
  98. <li>Detail:&nbsp;</li>
  99. <li>Field&nbsp;|&nbsp;</li>
  100. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  101. <li><a href="#method.detail">Method</a></li>
  102. </ul>
  103. </div>
  104. <a id="skip.navbar.top">
  105. <!-- -->
  106. </a></div>
  107. <!-- ========= END OF TOP NAVBAR ========= -->
  108. </div>
  109. <div class="navPadding">&nbsp;</div>
  110. <script type="text/javascript"><!--
  111. $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  112. //-->
  113. </script>
  114. </nav>
  115. </header>
  116. <!-- ======== START OF CLASS DATA ======== -->
  117. <main role="main">
  118. <div class="header">
  119. <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">javassist</a></div>
  120. <h2 title="Class CtField.Initializer" class="title">Class CtField.Initializer</h2>
  121. </div>
  122. <div class="contentContainer">
  123. <ul class="inheritance">
  124. <li>java.lang.Object</li>
  125. <li>
  126. <ul class="inheritance">
  127. <li>javassist.CtField.Initializer</li>
  128. </ul>
  129. </li>
  130. </ul>
  131. <div class="description">
  132. <ul class="blockList">
  133. <li class="blockList">
  134. <dl>
  135. <dt>Enclosing class:</dt>
  136. <dd><a href="CtField.html" title="class in javassist">CtField</a></dd>
  137. </dl>
  138. <hr>
  139. <pre>public abstract static class <span class="typeNameLabel">CtField.Initializer</span>
  140. extends java.lang.Object</pre>
  141. <div class="block">Instances of this class specify how to initialize a field.
  142. <code>Initializer</code> is passed to
  143. <code>CtClass.addField()</code> with a <code>CtField</code>.
  144. <p>This class cannot be instantiated with the <code>new</code> operator.
  145. Factory methods such as <code>byParameter()</code> and
  146. <code>byNew</code>
  147. must be used for the instantiation. They create a new instance with
  148. the given parameters and return it.</div>
  149. <dl>
  150. <dt><span class="seeLabel">See Also:</span></dt>
  151. <dd><a href="CtClass.html#addField(javassist.CtField,javassist.CtField.Initializer)"><code>CtClass.addField(CtField,CtField.Initializer)</code></a></dd>
  152. </dl>
  153. </li>
  154. </ul>
  155. </div>
  156. <div class="summary">
  157. <ul class="blockList">
  158. <li class="blockList">
  159. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  160. <section role="region">
  161. <ul class="blockList">
  162. <li class="blockList"><a id="constructor.summary">
  163. <!-- -->
  164. </a>
  165. <h3>Constructor Summary</h3>
  166. <table class="memberSummary">
  167. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  168. <tr>
  169. <th class="colFirst" scope="col">Constructor</th>
  170. <th class="colLast" scope="col">Description</th>
  171. </tr>
  172. <tr class="altColor">
  173. <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Initializer</a></span>()</code></th>
  174. <td class="colLast">&nbsp;</td>
  175. </tr>
  176. </table>
  177. </li>
  178. </ul>
  179. </section>
  180. <!-- ========== METHOD SUMMARY =========== -->
  181. <section role="region">
  182. <ul class="blockList">
  183. <li class="blockList"><a id="method.summary">
  184. <!-- -->
  185. </a>
  186. <h3>Method Summary</h3>
  187. <table class="memberSummary">
  188. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static 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>
  189. <tr>
  190. <th class="colFirst" scope="col">Modifier and Type</th>
  191. <th class="colSecond" scope="col">Method</th>
  192. <th class="colLast" scope="col">Description</th>
  193. </tr>
  194. <tr id="i0" class="altColor">
  195. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  196. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byCall(javassist.CtClass,java.lang.String)">byCall</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  197. java.lang.String&nbsp;methodName)</code></th>
  198. <td class="colLast">
  199. <div class="block">Makes an initializer calling a static method.</div>
  200. </td>
  201. </tr>
  202. <tr id="i1" class="rowColor">
  203. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  204. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byCall(javassist.CtClass,java.lang.String,java.lang.String%5B%5D)">byCall</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  205. java.lang.String&nbsp;methodName,
  206. java.lang.String[]&nbsp;stringParams)</code></th>
  207. <td class="colLast">
  208. <div class="block">Makes an initializer calling a static method.</div>
  209. </td>
  210. </tr>
  211. <tr id="i2" class="altColor">
  212. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  213. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byCallWithParams(javassist.CtClass,java.lang.String)">byCallWithParams</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  214. java.lang.String&nbsp;methodName)</code></th>
  215. <td class="colLast">
  216. <div class="block">Makes an initializer calling a static method.</div>
  217. </td>
  218. </tr>
  219. <tr id="i3" class="rowColor">
  220. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  221. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byCallWithParams(javassist.CtClass,java.lang.String,java.lang.String%5B%5D)">byCallWithParams</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  222. java.lang.String&nbsp;methodName,
  223. java.lang.String[]&nbsp;stringParams)</code></th>
  224. <td class="colLast">
  225. <div class="block">Makes an initializer calling a static method.</div>
  226. </td>
  227. </tr>
  228. <tr id="i4" class="altColor">
  229. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  230. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byExpr(java.lang.String)">byExpr</a></span>&#8203;(java.lang.String&nbsp;source)</code></th>
  231. <td class="colLast">
  232. <div class="block">Makes an initializer.</div>
  233. </td>
  234. </tr>
  235. <tr id="i5" class="rowColor">
  236. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  237. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byNew(javassist.CtClass)">byNew</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType)</code></th>
  238. <td class="colLast">
  239. <div class="block">Makes an initializer creating a new object.</div>
  240. </td>
  241. </tr>
  242. <tr id="i6" class="altColor">
  243. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  244. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byNew(javassist.CtClass,java.lang.String%5B%5D)">byNew</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType,
  245. java.lang.String[]&nbsp;stringParams)</code></th>
  246. <td class="colLast">
  247. <div class="block">Makes an initializer creating a new object.</div>
  248. </td>
  249. </tr>
  250. <tr id="i7" class="rowColor">
  251. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  252. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byNewArray(javassist.CtClass,int)">byNewArray</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;type,
  253. int&nbsp;size)</code></th>
  254. <td class="colLast">
  255. <div class="block">Makes an initializer creating a new array.</div>
  256. </td>
  257. </tr>
  258. <tr id="i8" class="altColor">
  259. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  260. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byNewArray(javassist.CtClass,int%5B%5D)">byNewArray</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;type,
  261. int[]&nbsp;sizes)</code></th>
  262. <td class="colLast">
  263. <div class="block">Makes an initializer creating a new multi-dimensional array.</div>
  264. </td>
  265. </tr>
  266. <tr id="i9" class="rowColor">
  267. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  268. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byNewWithParams(javassist.CtClass)">byNewWithParams</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType)</code></th>
  269. <td class="colLast">
  270. <div class="block">Makes an initializer creating a new object.</div>
  271. </td>
  272. </tr>
  273. <tr id="i10" class="altColor">
  274. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  275. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byNewWithParams(javassist.CtClass,java.lang.String%5B%5D)">byNewWithParams</a></span>&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType,
  276. java.lang.String[]&nbsp;stringParams)</code></th>
  277. <td class="colLast">
  278. <div class="block">Makes an initializer creating a new object.</div>
  279. </td>
  280. </tr>
  281. <tr id="i11" class="rowColor">
  282. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  283. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byParameter(int)">byParameter</a></span>&#8203;(int&nbsp;nth)</code></th>
  284. <td class="colLast">
  285. <div class="block">Makes an initializer using a constructor parameter.</div>
  286. </td>
  287. </tr>
  288. <tr id="i12" class="altColor">
  289. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  290. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#constant(boolean)">constant</a></span>&#8203;(boolean&nbsp;b)</code></th>
  291. <td class="colLast">
  292. <div class="block">Makes an initializer that assigns a constant boolean value.</div>
  293. </td>
  294. </tr>
  295. <tr id="i13" class="rowColor">
  296. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  297. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#constant(double)">constant</a></span>&#8203;(double&nbsp;d)</code></th>
  298. <td class="colLast">
  299. <div class="block">Makes an initializer that assigns a constant double value.</div>
  300. </td>
  301. </tr>
  302. <tr id="i14" class="altColor">
  303. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  304. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#constant(float)">constant</a></span>&#8203;(float&nbsp;l)</code></th>
  305. <td class="colLast">
  306. <div class="block">Makes an initializer that assigns a constant float value.</div>
  307. </td>
  308. </tr>
  309. <tr id="i15" class="rowColor">
  310. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  311. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#constant(int)">constant</a></span>&#8203;(int&nbsp;i)</code></th>
  312. <td class="colLast">
  313. <div class="block">Makes an initializer that assigns a constant integer value.</div>
  314. </td>
  315. </tr>
  316. <tr id="i16" class="altColor">
  317. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  318. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#constant(long)">constant</a></span>&#8203;(long&nbsp;l)</code></th>
  319. <td class="colLast">
  320. <div class="block">Makes an initializer that assigns a constant long value.</div>
  321. </td>
  322. </tr>
  323. <tr id="i17" class="rowColor">
  324. <td class="colFirst"><code>static <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a></code></td>
  325. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#constant(java.lang.String)">constant</a></span>&#8203;(java.lang.String&nbsp;s)</code></th>
  326. <td class="colLast">
  327. <div class="block">Makes an initializer that assigns a constant string value.</div>
  328. </td>
  329. </tr>
  330. </table>
  331. <ul class="blockList">
  332. <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
  333. <!-- -->
  334. </a>
  335. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  336. <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  337. </ul>
  338. </li>
  339. </ul>
  340. </section>
  341. </li>
  342. </ul>
  343. </div>
  344. <div class="details">
  345. <ul class="blockList">
  346. <li class="blockList">
  347. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  348. <section role="region">
  349. <ul class="blockList">
  350. <li class="blockList"><a id="constructor.detail">
  351. <!-- -->
  352. </a>
  353. <h3>Constructor Detail</h3>
  354. <a id="&lt;init&gt;()">
  355. <!-- -->
  356. </a>
  357. <ul class="blockListLast">
  358. <li class="blockList">
  359. <h4>Initializer</h4>
  360. <pre>public&nbsp;Initializer()</pre>
  361. </li>
  362. </ul>
  363. </li>
  364. </ul>
  365. </section>
  366. <!-- ============ METHOD DETAIL ========== -->
  367. <section role="region">
  368. <ul class="blockList">
  369. <li class="blockList"><a id="method.detail">
  370. <!-- -->
  371. </a>
  372. <h3>Method Detail</h3>
  373. <a id="constant(int)">
  374. <!-- -->
  375. </a>
  376. <ul class="blockList">
  377. <li class="blockList">
  378. <h4>constant</h4>
  379. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;constant&#8203;(int&nbsp;i)</pre>
  380. <div class="block">Makes an initializer that assigns a constant integer value.
  381. The field must be integer, short, char, or byte type.</div>
  382. </li>
  383. </ul>
  384. <a id="constant(boolean)">
  385. <!-- -->
  386. </a>
  387. <ul class="blockList">
  388. <li class="blockList">
  389. <h4>constant</h4>
  390. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;constant&#8203;(boolean&nbsp;b)</pre>
  391. <div class="block">Makes an initializer that assigns a constant boolean value.
  392. The field must be boolean type.</div>
  393. </li>
  394. </ul>
  395. <a id="constant(long)">
  396. <!-- -->
  397. </a>
  398. <ul class="blockList">
  399. <li class="blockList">
  400. <h4>constant</h4>
  401. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;constant&#8203;(long&nbsp;l)</pre>
  402. <div class="block">Makes an initializer that assigns a constant long value.
  403. The field must be long type.</div>
  404. </li>
  405. </ul>
  406. <a id="constant(float)">
  407. <!-- -->
  408. </a>
  409. <ul class="blockList">
  410. <li class="blockList">
  411. <h4>constant</h4>
  412. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;constant&#8203;(float&nbsp;l)</pre>
  413. <div class="block">Makes an initializer that assigns a constant float value.
  414. The field must be float type.</div>
  415. </li>
  416. </ul>
  417. <a id="constant(double)">
  418. <!-- -->
  419. </a>
  420. <ul class="blockList">
  421. <li class="blockList">
  422. <h4>constant</h4>
  423. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;constant&#8203;(double&nbsp;d)</pre>
  424. <div class="block">Makes an initializer that assigns a constant double value.
  425. The field must be double type.</div>
  426. </li>
  427. </ul>
  428. <a id="constant(java.lang.String)">
  429. <!-- -->
  430. </a>
  431. <ul class="blockList">
  432. <li class="blockList">
  433. <h4>constant</h4>
  434. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;constant&#8203;(java.lang.String&nbsp;s)</pre>
  435. <div class="block">Makes an initializer that assigns a constant string value.
  436. The field must be <code>java.lang.String</code> type.</div>
  437. </li>
  438. </ul>
  439. <a id="byParameter(int)">
  440. <!-- -->
  441. </a>
  442. <ul class="blockList">
  443. <li class="blockList">
  444. <h4>byParameter</h4>
  445. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byParameter&#8203;(int&nbsp;nth)</pre>
  446. <div class="block">Makes an initializer using a constructor parameter.
  447. <p>The initial value is the
  448. N-th parameter given to the constructor of the object including
  449. the field. If the constructor takes less than N parameters,
  450. the field is not initialized.
  451. If the field is static, it is never initialized.</div>
  452. <dl>
  453. <dt><span class="paramLabel">Parameters:</span></dt>
  454. <dd><code>nth</code> - the n-th (&gt;= 0) parameter is used as
  455. the initial value.
  456. If nth is 0, then the first parameter is
  457. used.</dd>
  458. </dl>
  459. </li>
  460. </ul>
  461. <a id="byNew(javassist.CtClass)">
  462. <!-- -->
  463. </a>
  464. <ul class="blockList">
  465. <li class="blockList">
  466. <h4>byNew</h4>
  467. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byNew&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType)</pre>
  468. <div class="block">Makes an initializer creating a new object.
  469. <p>This initializer creates a new object and uses it as the initial
  470. value of the field. The constructor of the created object receives
  471. the parameter:
  472. <p><code>Object obj</code> - the object including the field.
  473. <p>If the initialized field is static, then the constructor does
  474. not receive any parameters.</div>
  475. <dl>
  476. <dt><span class="paramLabel">Parameters:</span></dt>
  477. <dd><code>objectType</code> - the class instantiated for the initial value.</dd>
  478. </dl>
  479. </li>
  480. </ul>
  481. <a id="byNew(javassist.CtClass,java.lang.String[])">
  482. <!-- -->
  483. </a>
  484. <ul class="blockList">
  485. <li class="blockList">
  486. <h4>byNew</h4>
  487. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byNew&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType,
  488. java.lang.String[]&nbsp;stringParams)</pre>
  489. <div class="block">Makes an initializer creating a new object.
  490. <p>This initializer creates a new object and uses it as the initial
  491. value of the field. The constructor of the created object receives
  492. the parameters:
  493. <p><code>Object obj</code> - the object including the field.<br>
  494. <code>String[] strs</code> - the character strings specified
  495. by <code>stringParams</code><br>
  496. <p>If the initialized field is static, then the constructor
  497. receives only <code>strs</code>.</div>
  498. <dl>
  499. <dt><span class="paramLabel">Parameters:</span></dt>
  500. <dd><code>objectType</code> - the class instantiated for the initial value.</dd>
  501. <dd><code>stringParams</code> - the array of strings passed to the
  502. constructor.</dd>
  503. </dl>
  504. </li>
  505. </ul>
  506. <a id="byNewWithParams(javassist.CtClass)">
  507. <!-- -->
  508. </a>
  509. <ul class="blockList">
  510. <li class="blockList">
  511. <h4>byNewWithParams</h4>
  512. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byNewWithParams&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType)</pre>
  513. <div class="block">Makes an initializer creating a new object.
  514. <p>This initializer creates a new object and uses it as the initial
  515. value of the field. The constructor of the created object receives
  516. the parameters:
  517. <p><code>Object obj</code> - the object including the field.<br>
  518. <code>Object[] args</code> - the parameters passed to the
  519. constructor of the object including the
  520. filed.
  521. <p>If the initialized field is static, then the constructor does
  522. not receive any parameters.</div>
  523. <dl>
  524. <dt><span class="paramLabel">Parameters:</span></dt>
  525. <dd><code>objectType</code> - the class instantiated for the initial value.</dd>
  526. <dt><span class="seeLabel">See Also:</span></dt>
  527. <dd><a href="#byNewArray(javassist.CtClass,int)"><code>byNewArray(CtClass,int)</code></a>,
  528. <a href="#byNewArray(javassist.CtClass,int%5B%5D)"><code>byNewArray(CtClass,int[])</code></a></dd>
  529. </dl>
  530. </li>
  531. </ul>
  532. <a id="byNewWithParams(javassist.CtClass,java.lang.String[])">
  533. <!-- -->
  534. </a>
  535. <ul class="blockList">
  536. <li class="blockList">
  537. <h4>byNewWithParams</h4>
  538. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byNewWithParams&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;objectType,
  539. java.lang.String[]&nbsp;stringParams)</pre>
  540. <div class="block">Makes an initializer creating a new object.
  541. <p>This initializer creates a new object and uses it as the initial
  542. value of the field. The constructor of the created object receives
  543. the parameters:
  544. <p><code>Object obj</code> - the object including the field.<br>
  545. <code>String[] strs</code> - the character strings specified
  546. by <code>stringParams</code><br>
  547. <code>Object[] args</code> - the parameters passed to the
  548. constructor of the object including the
  549. filed.
  550. <p>If the initialized field is static, then the constructor receives
  551. only <code>strs</code>.</div>
  552. <dl>
  553. <dt><span class="paramLabel">Parameters:</span></dt>
  554. <dd><code>objectType</code> - the class instantiated for the initial value.</dd>
  555. <dd><code>stringParams</code> - the array of strings passed to the
  556. constructor.</dd>
  557. </dl>
  558. </li>
  559. </ul>
  560. <a id="byCall(javassist.CtClass,java.lang.String)">
  561. <!-- -->
  562. </a>
  563. <ul class="blockList">
  564. <li class="blockList">
  565. <h4>byCall</h4>
  566. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byCall&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  567. java.lang.String&nbsp;methodName)</pre>
  568. <div class="block">Makes an initializer calling a static method.
  569. <p>This initializer calls a static method and uses the returned
  570. value as the initial value of the field.
  571. The called method receives the parameters:
  572. <p><code>Object obj</code> - the object including the field.
  573. <p>If the initialized field is static, then the method does
  574. not receive any parameters.
  575. <p>The type of the returned value must be the same as the field
  576. type.</div>
  577. <dl>
  578. <dt><span class="paramLabel">Parameters:</span></dt>
  579. <dd><code>methodClass</code> - the class that the static method is
  580. declared in.</dd>
  581. <dd><code>methodName</code> - the name of the satic method.</dd>
  582. </dl>
  583. </li>
  584. </ul>
  585. <a id="byCall(javassist.CtClass,java.lang.String,java.lang.String[])">
  586. <!-- -->
  587. </a>
  588. <ul class="blockList">
  589. <li class="blockList">
  590. <h4>byCall</h4>
  591. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byCall&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  592. java.lang.String&nbsp;methodName,
  593. java.lang.String[]&nbsp;stringParams)</pre>
  594. <div class="block">Makes an initializer calling a static method.
  595. <p>This initializer calls a static method and uses the returned
  596. value as the initial value of the field. The called method
  597. receives the parameters:
  598. <p><code>Object obj</code> - the object including the field.<br>
  599. <code>String[] strs</code> - the character strings specified
  600. by <code>stringParams</code><br>
  601. <p>If the initialized field is static, then the method
  602. receive only <code>strs</code>.
  603. <p>The type of the returned value must be the same as the field
  604. type.</div>
  605. <dl>
  606. <dt><span class="paramLabel">Parameters:</span></dt>
  607. <dd><code>methodClass</code> - the class that the static method is
  608. declared in.</dd>
  609. <dd><code>methodName</code> - the name of the satic method.</dd>
  610. <dd><code>stringParams</code> - the array of strings passed to the
  611. static method.</dd>
  612. </dl>
  613. </li>
  614. </ul>
  615. <a id="byCallWithParams(javassist.CtClass,java.lang.String)">
  616. <!-- -->
  617. </a>
  618. <ul class="blockList">
  619. <li class="blockList">
  620. <h4>byCallWithParams</h4>
  621. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byCallWithParams&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  622. java.lang.String&nbsp;methodName)</pre>
  623. <div class="block">Makes an initializer calling a static method.
  624. <p>This initializer calls a static method and uses the returned
  625. value as the initial value of the field. The called method
  626. receives the parameters:
  627. <p><code>Object obj</code> - the object including the field.<br>
  628. <code>Object[] args</code> - the parameters passed to the
  629. constructor of the object including the
  630. filed.
  631. <p>If the initialized field is static, then the method does
  632. not receive any parameters.
  633. <p>The type of the returned value must be the same as the field
  634. type.</div>
  635. <dl>
  636. <dt><span class="paramLabel">Parameters:</span></dt>
  637. <dd><code>methodClass</code> - the class that the static method is
  638. declared in.</dd>
  639. <dd><code>methodName</code> - the name of the satic method.</dd>
  640. </dl>
  641. </li>
  642. </ul>
  643. <a id="byCallWithParams(javassist.CtClass,java.lang.String,java.lang.String[])">
  644. <!-- -->
  645. </a>
  646. <ul class="blockList">
  647. <li class="blockList">
  648. <h4>byCallWithParams</h4>
  649. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byCallWithParams&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;methodClass,
  650. java.lang.String&nbsp;methodName,
  651. java.lang.String[]&nbsp;stringParams)</pre>
  652. <div class="block">Makes an initializer calling a static method.
  653. <p>This initializer calls a static method and uses the returned
  654. value as the initial value of the field. The called method
  655. receives the parameters:
  656. <p><code>Object obj</code> - the object including the field.<br>
  657. <code>String[] strs</code> - the character strings specified
  658. by <code>stringParams</code><br>
  659. <code>Object[] args</code> - the parameters passed to the
  660. constructor of the object including the
  661. filed.
  662. <p>If the initialized field is static, then the method
  663. receive only <code>strs</code>.
  664. <p>The type of the returned value must be the same as the field
  665. type.</div>
  666. <dl>
  667. <dt><span class="paramLabel">Parameters:</span></dt>
  668. <dd><code>methodClass</code> - the class that the static method is
  669. declared in.</dd>
  670. <dd><code>methodName</code> - the name of the satic method.</dd>
  671. <dd><code>stringParams</code> - the array of strings passed to the
  672. static method.</dd>
  673. </dl>
  674. </li>
  675. </ul>
  676. <a id="byNewArray(javassist.CtClass,int)">
  677. <!-- -->
  678. </a>
  679. <ul class="blockList">
  680. <li class="blockList">
  681. <h4>byNewArray</h4>
  682. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byNewArray&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;type,
  683. int&nbsp;size)
  684. throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
  685. <div class="block">Makes an initializer creating a new array.</div>
  686. <dl>
  687. <dt><span class="paramLabel">Parameters:</span></dt>
  688. <dd><code>type</code> - the type of the array.</dd>
  689. <dd><code>size</code> - the size of the array.</dd>
  690. <dt><span class="throwsLabel">Throws:</span></dt>
  691. <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code> - if the type of the array components
  692. is not found.</dd>
  693. </dl>
  694. </li>
  695. </ul>
  696. <a id="byNewArray(javassist.CtClass,int[])">
  697. <!-- -->
  698. </a>
  699. <ul class="blockList">
  700. <li class="blockList">
  701. <h4>byNewArray</h4>
  702. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byNewArray&#8203;(<a href="CtClass.html" title="class in javassist">CtClass</a>&nbsp;type,
  703. int[]&nbsp;sizes)</pre>
  704. <div class="block">Makes an initializer creating a new multi-dimensional array.</div>
  705. <dl>
  706. <dt><span class="paramLabel">Parameters:</span></dt>
  707. <dd><code>type</code> - the type of the array.</dd>
  708. <dd><code>sizes</code> - an <code>int</code> array of the size in every
  709. dimension.
  710. The first element is the size in the first
  711. dimension. The second is in the second, etc.</dd>
  712. </dl>
  713. </li>
  714. </ul>
  715. <a id="byExpr(java.lang.String)">
  716. <!-- -->
  717. </a>
  718. <ul class="blockListLast">
  719. <li class="blockList">
  720. <h4>byExpr</h4>
  721. <pre class="methodSignature">public static&nbsp;<a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a>&nbsp;byExpr&#8203;(java.lang.String&nbsp;source)</pre>
  722. <div class="block">Makes an initializer.</div>
  723. <dl>
  724. <dt><span class="paramLabel">Parameters:</span></dt>
  725. <dd><code>source</code> - initializer expression.</dd>
  726. </dl>
  727. </li>
  728. </ul>
  729. </li>
  730. </ul>
  731. </section>
  732. </li>
  733. </ul>
  734. </div>
  735. </div>
  736. </main>
  737. <!-- ========= END OF CLASS DATA ========= -->
  738. <footer role="contentinfo">
  739. <nav role="navigation">
  740. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  741. <div class="bottomNav"><a id="navbar.bottom">
  742. <!-- -->
  743. </a>
  744. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  745. <a id="navbar.bottom.firstrow">
  746. <!-- -->
  747. </a>
  748. <ul class="navList" title="Navigation">
  749. <li><a href="../index.html">Overview</a></li>
  750. <li><a href="package-summary.html">Package</a></li>
  751. <li class="navBarCell1Rev">Class</li>
  752. <li><a href="class-use/CtField.Initializer.html">Use</a></li>
  753. <li><a href="package-tree.html">Tree</a></li>
  754. <li><a href="../deprecated-list.html">Deprecated</a></li>
  755. <li><a href="../index-all.html">Index</a></li>
  756. </ul>
  757. </div>
  758. <div class="subNav">
  759. <ul class="navList" id="allclasses_navbar_bottom">
  760. <li><a href="../allclasses.html">All&nbsp;Classes</a></li>
  761. </ul>
  762. <div>
  763. <script type="text/javascript"><!--
  764. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  765. if(window==top) {
  766. allClassesLink.style.display = "block";
  767. }
  768. else {
  769. allClassesLink.style.display = "none";
  770. }
  771. //-->
  772. </script>
  773. <noscript>
  774. <div>JavaScript is disabled on your browser.</div>
  775. </noscript>
  776. </div>
  777. <div>
  778. <ul class="subNavList">
  779. <li>Summary:&nbsp;</li>
  780. <li>Nested&nbsp;|&nbsp;</li>
  781. <li>Field&nbsp;|&nbsp;</li>
  782. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  783. <li><a href="#method.summary">Method</a></li>
  784. </ul>
  785. <ul class="subNavList">
  786. <li>Detail:&nbsp;</li>
  787. <li>Field&nbsp;|&nbsp;</li>
  788. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  789. <li><a href="#method.detail">Method</a></li>
  790. </ul>
  791. </div>
  792. <a id="skip.navbar.bottom">
  793. <!-- -->
  794. </a></div>
  795. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  796. </nav>
  797. <p class="legalCopy"><small><i>Javassist, a Java-bytecode translator toolkit.<br>
  798. Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.</i></small></p>
  799. </footer>
  800. </body>
  801. </html>