1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169 |
- <!DOCTYPE HTML>
- <!-- NewPage -->
- <html lang="en">
- <head>
- <!-- Generated by javadoc (11) on Sat May 08 11:16:00 JST 2021 -->
- <title>CtClass (Javassist API)</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="dc.created" content="2021-05-08">
- <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="CtClass (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,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":42,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":9,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10,"i80":10,"i81":10,"i82":10,"i83":10,"i84":10,"i85":10,"i86":10,"i87":10,"i88":42,"i89":10,"i90":10,"i91":10,"i92":10,"i93":10};
- var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/CtClass.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 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: </li>
- <li>Nested | </li>
- <li><a href="#field.summary">Field</a> | </li>
- <li>Constr | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li><a href="#field.detail">Field</a> | </li>
- <li>Constr | </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"> </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> <a href="package-summary.html">javassist</a></div>
- <h2 title="Class CtClass" class="title">Class CtClass</h2>
- </div>
- <div class="contentContainer">
- <ul class="inheritance">
- <li>java.lang.Object</li>
- <li>
- <ul class="inheritance">
- <li>javassist.CtClass</li>
- </ul>
- </li>
- </ul>
- <div class="description">
- <ul class="blockList">
- <li class="blockList">
- <dl>
- <dt>Direct Known Subclasses:</dt>
- <dd><code><a href="CtPrimitiveType.html" title="class in javassist">CtPrimitiveType</a></code></dd>
- </dl>
- <hr>
- <pre>public abstract class <span class="typeNameLabel">CtClass</span>
- extends java.lang.Object</pre>
- <div class="block">An instance of <code>CtClass</code> represents a class.
- It is obtained from <code>ClassPool</code>.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="ClassPool.html#get(java.lang.String)"><code>ClassPool.get(String)</code></a></dd>
- </dl>
- </li>
- </ul>
- </div>
- <div class="summary">
- <ul class="blockList">
- <li class="blockList">
- <!-- =========== FIELD SUMMARY =========== -->
- <section role="region">
- <ul class="blockList">
- <li class="blockList"><a id="field.summary">
- <!-- -->
- </a>
- <h3>Field Summary</h3>
- <table class="memberSummary">
- <caption><span>Fields</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colSecond" scope="col">Field</th>
- <th class="colLast" scope="col">Description</th>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#booleanType">booleanType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>boolean</code> type.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byteType">byteType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>byte</code> type.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#charType">charType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>char</code> type.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#debugDump">debugDump</a></span></code></th>
- <td class="colLast">
- <div class="block">If the value of this field is not null, then all class
- files modified by Javassist are saved under the directory
- specified by this variable.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doubleType">doubleType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>double</code> type.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#floatType">floatType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>float</code> type.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#intType">intType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>int</code> type.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#longType">longType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>long</code> type.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shortType">shortType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>short</code> type.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#version">version</a></span></code></th>
- <td class="colLast">
- <div class="block">The version number of this release.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#voidType">voidType</a></span></code></th>
- <td class="colLast">
- <div class="block">The <code>CtClass</code> object representing
- the <code>void</code> type.</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"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </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>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addConstructor(javassist.CtConstructor)">addConstructor</a></span>​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> c)</code></th>
- <td class="colLast">
- <div class="block">Adds a constructor.</div>
- </td>
- </tr>
- <tr id="i1" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addField(javassist.CtField)">addField</a></span>​(<a href="CtField.html" title="class in javassist">CtField</a> f)</code></th>
- <td class="colLast">
- <div class="block">Adds a field.</div>
- </td>
- </tr>
- <tr id="i2" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addField(javassist.CtField,java.lang.String)">addField</a></span>​(<a href="CtField.html" title="class in javassist">CtField</a> f,
- java.lang.String init)</code></th>
- <td class="colLast">
- <div class="block">Adds a field with an initial value.</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="#addField(javassist.CtField,javassist.CtField.Initializer)">addField</a></span>​(<a href="CtField.html" title="class in javassist">CtField</a> f,
- <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a> init)</code></th>
- <td class="colLast">
- <div class="block">Adds a field with an initial value.</div>
- </td>
- </tr>
- <tr id="i4" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addInterface(javassist.CtClass)">addInterface</a></span>​(<a href="CtClass.html" title="class in javassist">CtClass</a> anInterface)</code></th>
- <td class="colLast">
- <div class="block">Adds an interface.</div>
- </td>
- </tr>
- <tr id="i5" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMethod(javassist.CtMethod)">addMethod</a></span>​(<a href="CtMethod.html" title="class in javassist">CtMethod</a> m)</code></th>
- <td class="colLast">
- <div class="block">Adds a method.</div>
- </td>
- </tr>
- <tr id="i6" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#debugWriteFile()">debugWriteFile</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Writes a class file as <code>writeFile()</code> does although this
- method does not prune or freeze the class after writing the class
- file.</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="#debugWriteFile(java.lang.String)">debugWriteFile</a></span>​(java.lang.String directoryName)</code></th>
- <td class="colLast">
- <div class="block">Writes a class file as <code>writeFile()</code> does although this
- method does not prune or freeze the class after writing the class
- file.</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="#defrost()">defrost</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Defrosts the class so that the class can be modified again.</div>
- </td>
- </tr>
- <tr id="i9" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#detach()">detach</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Removes this <code>CtClass</code> object from the
- <code>ClassPool</code>.</div>
- </td>
- </tr>
- <tr id="i10" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#freeze()">freeze</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Makes the class frozen.</div>
- </td>
- </tr>
- <tr id="i11" class="rowColor">
- <td class="colFirst"><code>javassist.compiler.AccessorMaker</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAccessorMaker()">getAccessorMaker</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Undocumented method.</div>
- </td>
- </tr>
- <tr id="i12" class="altColor">
- <td class="colFirst"><code>java.lang.Object</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAnnotation(java.lang.Class)">getAnnotation</a></span>​(java.lang.Class<?> clz)</code></th>
- <td class="colLast">
- <div class="block">Returns the annotation if the class has the specified annotation type.</div>
- </td>
- </tr>
- <tr id="i13" class="rowColor">
- <td class="colFirst"><code>java.lang.Object[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAnnotations()">getAnnotations</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns the annotations associated with this class.</div>
- </td>
- </tr>
- <tr id="i14" class="altColor">
- <td class="colFirst"><code>byte[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAttribute(java.lang.String)">getAttribute</a></span>​(java.lang.String name)</code></th>
- <td class="colLast">
- <div class="block">Obtains an attribute with the given name.</div>
- </td>
- </tr>
- <tr id="i15" class="rowColor">
- <td class="colFirst"><code>java.lang.Object[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAvailableAnnotations()">getAvailableAnnotations</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns the annotations associated with this class.</div>
- </td>
- </tr>
- <tr id="i16" class="altColor">
- <td class="colFirst"><code><a href="bytecode/ClassFile.html" title="class in javassist.bytecode">ClassFile</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getClassFile()">getClassFile</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns a class file for this class.</div>
- </td>
- </tr>
- <tr id="i17" class="rowColor">
- <td class="colFirst"><code><a href="bytecode/ClassFile.html" title="class in javassist.bytecode">ClassFile</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getClassFile2()">getClassFile2</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns a class file for this class (read only).</div>
- </td>
- </tr>
- <tr id="i18" class="altColor">
- <td class="colFirst"><code><a href="CtConstructor.html" title="class in javassist">CtConstructor</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getClassInitializer()">getClassInitializer</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Gets the class initializer (static constructor)
- declared in the class.</div>
- </td>
- </tr>
- <tr id="i19" class="rowColor">
- <td class="colFirst"><code><a href="ClassPool.html" title="class in javassist">ClassPool</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getClassPool()">getClassPool</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns a <code>ClassPool</code> for this class.</div>
- </td>
- </tr>
- <tr id="i20" class="altColor">
- <td class="colFirst"><code><a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getComponentType()">getComponentType</a></span>()</code></th>
- <td class="colLast">
- <div class="block">If this object represents an array, this method returns the component
- type of the array.</div>
- </td>
- </tr>
- <tr id="i21" class="rowColor">
- <td class="colFirst"><code><a href="CtConstructor.html" title="class in javassist">CtConstructor</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getConstructor(java.lang.String)">getConstructor</a></span>​(java.lang.String desc)</code></th>
- <td class="colLast">
- <div class="block">Returns the constructor with the given signature,
- which is represented by a character string
- called method descriptor.</div>
- </td>
- </tr>
- <tr id="i22" class="altColor">
- <td class="colFirst"><code><a href="CtConstructor.html" title="class in javassist">CtConstructor</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getConstructors()">getConstructors</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns an array containing <code>CtConstructor</code> objects
- representing all the non-private constructors of the class.</div>
- </td>
- </tr>
- <tr id="i23" class="rowColor">
- <td class="colFirst"><code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredBehaviors()">getDeclaredBehaviors</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Gets all the constructors and methods declared in the class.</div>
- </td>
- </tr>
- <tr id="i24" class="altColor">
- <td class="colFirst"><code><a href="CtClass.html" title="class in javassist">CtClass</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredClasses()">getDeclaredClasses</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns an array of nested classes declared in the class.</div>
- </td>
- </tr>
- <tr id="i25" class="rowColor">
- <td class="colFirst"><code><a href="CtConstructor.html" title="class in javassist">CtConstructor</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredConstructor(javassist.CtClass%5B%5D)">getDeclaredConstructor</a></span>​(<a href="CtClass.html" title="class in javassist">CtClass</a>[] params)</code></th>
- <td class="colLast">
- <div class="block">Returns a constructor receiving the specified parameters.</div>
- </td>
- </tr>
- <tr id="i26" class="altColor">
- <td class="colFirst"><code><a href="CtConstructor.html" title="class in javassist">CtConstructor</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredConstructors()">getDeclaredConstructors</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Gets all the constructors declared in the class.</div>
- </td>
- </tr>
- <tr id="i27" class="rowColor">
- <td class="colFirst"><code><a href="CtField.html" title="class in javassist">CtField</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredField(java.lang.String)">getDeclaredField</a></span>​(java.lang.String name)</code></th>
- <td class="colLast">
- <div class="block">Retrieves the field with the specified name among the fields
- declared in the class.</div>
- </td>
- </tr>
- <tr id="i28" class="altColor">
- <td class="colFirst"><code><a href="CtField.html" title="class in javassist">CtField</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredField(java.lang.String,java.lang.String)">getDeclaredField</a></span>​(java.lang.String name,
- java.lang.String desc)</code></th>
- <td class="colLast">
- <div class="block">Retrieves the field with the specified name and type among the fields
- declared in the class.</div>
- </td>
- </tr>
- <tr id="i29" class="rowColor">
- <td class="colFirst"><code><a href="CtField.html" title="class in javassist">CtField</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredFields()">getDeclaredFields</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Gets all the fields declared in the class.</div>
- </td>
- </tr>
- <tr id="i30" 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="#getDeclaredMethod(java.lang.String)">getDeclaredMethod</a></span>​(java.lang.String name)</code></th>
- <td class="colLast">
- <div class="block">Retrieves the method with the specified name among the methods
- declared in the class.</div>
- </td>
- </tr>
- <tr id="i31" 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="#getDeclaredMethod(java.lang.String,javassist.CtClass%5B%5D)">getDeclaredMethod</a></span>​(java.lang.String name,
- <a href="CtClass.html" title="class in javassist">CtClass</a>[] params)</code></th>
- <td class="colLast">
- <div class="block">Retrieves the method with the specified name and parameter types
- among the methods declared in the class.</div>
- </td>
- </tr>
- <tr id="i32" 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="#getDeclaredMethods()">getDeclaredMethods</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Gets all methods declared in the class.</div>
- </td>
- </tr>
- <tr id="i33" 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="#getDeclaredMethods(java.lang.String)">getDeclaredMethods</a></span>​(java.lang.String name)</code></th>
- <td class="colLast">
- <div class="block">Retrieves methods with the specified name among the methods
- declared in the class.</div>
- </td>
- </tr>
- <tr id="i34" class="altColor">
- <td class="colFirst"><code><a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaringClass()">getDeclaringClass</a></span>()</code></th>
- <td class="colLast">
- <div class="block">If this class is a member class or interface of another class,
- then the class enclosing this class is returned.</div>
- </td>
- </tr>
- <tr id="i35" class="rowColor">
- <td class="colFirst"><code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getEnclosingBehavior()">getEnclosingBehavior</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns the immediately enclosing method of this class.</div>
- </td>
- </tr>
- <tr id="i36" 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="#getEnclosingMethod()">getEnclosingMethod</a></span>()</code></th>
- <td class="colLast">
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="deprecationComment">The enclosing method might be a constructor.</div>
- </div>
- </td>
- </tr>
- <tr id="i37" class="rowColor">
- <td class="colFirst"><code><a href="CtField.html" title="class in javassist">CtField</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getField(java.lang.String)">getField</a></span>​(java.lang.String name)</code></th>
- <td class="colLast">
- <div class="block">Returns the field with the specified name.</div>
- </td>
- </tr>
- <tr id="i38" class="altColor">
- <td class="colFirst"><code><a href="CtField.html" title="class in javassist">CtField</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getField(java.lang.String,java.lang.String)">getField</a></span>​(java.lang.String name,
- java.lang.String desc)</code></th>
- <td class="colLast">
- <div class="block">Returns the field with the specified name and type.</div>
- </td>
- </tr>
- <tr id="i39" class="rowColor">
- <td class="colFirst"><code><a href="CtField.html" title="class in javassist">CtField</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFields()">getFields</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns an array containing <code>CtField</code> objects
- representing all the non-private fields of the class.</div>
- </td>
- </tr>
- <tr id="i40" class="altColor">
- <td class="colFirst"><code>java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getGenericSignature()">getGenericSignature</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns the generic signature of the class.</div>
- </td>
- </tr>
- <tr id="i41" class="rowColor">
- <td class="colFirst"><code><a href="CtClass.html" title="class in javassist">CtClass</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getInterfaces()">getInterfaces</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Obtains the class objects representing the interfaces implemented
- by the class or, if this object represents an interface, the interfaces
- extended by that interface.</div>
- </td>
- </tr>
- <tr id="i42" 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="#getMethod(java.lang.String,java.lang.String)">getMethod</a></span>​(java.lang.String name,
- java.lang.String desc)</code></th>
- <td class="colLast">
- <div class="block">Returns the method with the given name and signature.</div>
- </td>
- </tr>
- <tr id="i43" 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="#getMethods()">getMethods</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns an array containing <code>CtMethod</code> objects
- representing all the non-private methods of the class.</div>
- </td>
- </tr>
- <tr id="i44" class="altColor">
- <td class="colFirst"><code>int</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getModifiers()">getModifiers</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns the modifiers for this class, encoded in an integer.</div>
- </td>
- </tr>
- <tr id="i45" class="rowColor">
- <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 fully-qualified name of the class.</div>
- </td>
- </tr>
- <tr id="i46" class="altColor">
- <td class="colFirst"><code><a href="CtClass.html" title="class in javassist">CtClass</a>[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNestedClasses()">getNestedClasses</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns an array of nested classes declared in the class.</div>
- </td>
- </tr>
- <tr id="i47" class="rowColor">
- <td class="colFirst"><code>java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPackageName()">getPackageName</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Obtains the package name.</div>
- </td>
- </tr>
- <tr id="i48" class="altColor">
- <td class="colFirst"><code>java.util.Collection<java.lang.String></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRefClasses()">getRefClasses</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns a collection of the names of all the classes
- referenced in this class.</div>
- </td>
- </tr>
- <tr id="i49" class="rowColor">
- <td class="colFirst"><code>java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSimpleName()">getSimpleName</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Obtains the not-qualified class name.</div>
- </td>
- </tr>
- <tr id="i50" class="altColor">
- <td class="colFirst"><code><a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSuperclass()">getSuperclass</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Obtains the class object representing the superclass of the
- class.</div>
- </td>
- </tr>
- <tr id="i51" class="rowColor">
- <td class="colFirst"><code>java.net.URL</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getURL()">getURL</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns the uniform resource locator (URL) of the class file.</div>
- </td>
- </tr>
- <tr id="i52" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasAnnotation(java.lang.Class)">hasAnnotation</a></span>​(java.lang.Class<?> annotationType)</code></th>
- <td class="colLast">
- <div class="block">Returns true if the class has the specified annotation type.</div>
- </td>
- </tr>
- <tr id="i53" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasAnnotation(java.lang.String)">hasAnnotation</a></span>​(java.lang.String annotationTypeName)</code></th>
- <td class="colLast">
- <div class="block">Returns true if the class has the specified annotation type.</div>
- </td>
- </tr>
- <tr id="i54" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#instrument(javassist.CodeConverter)">instrument</a></span>​(<a href="CodeConverter.html" title="class in javassist">CodeConverter</a> converter)</code></th>
- <td class="colLast">
- <div class="block">Applies the given converter to all methods and constructors
- declared in the class.</div>
- </td>
- </tr>
- <tr id="i55" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#instrument(javassist.expr.ExprEditor)">instrument</a></span>​(<a href="expr/ExprEditor.html" title="class in javassist.expr">ExprEditor</a> editor)</code></th>
- <td class="colLast">
- <div class="block">Modifies the bodies of all methods and constructors
- declared in the class.</div>
- </td>
- </tr>
- <tr id="i56" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAnnotation()">isAnnotation</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Determines whether this object represents an annotation type.</div>
- </td>
- </tr>
- <tr id="i57" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isArray()">isArray</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns <code>true</code> if this object represents an array type.</div>
- </td>
- </tr>
- <tr id="i58" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEnum()">isEnum</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Determines whether this object represents an enum.</div>
- </td>
- </tr>
- <tr id="i59" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isFrozen()">isFrozen</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns true if the class has been loaded or written out
- and thus it cannot be modified any more.</div>
- </td>
- </tr>
- <tr id="i60" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isInterface()">isInterface</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Determines whether this object represents a class or an interface.</div>
- </td>
- </tr>
- <tr id="i61" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isKotlin()">isKotlin</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns <code>true</code> if this object represents a Kotlin class.</div>
- </td>
- </tr>
- <tr id="i62" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isModified()">isModified</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns true if the definition of the class has been modified.</div>
- </td>
- </tr>
- <tr id="i63" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isPrimitive()">isPrimitive</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns <code>true</code> if this object represents a primitive
- Java type: boolean, byte, char, short, int, long, float, double,
- or void.</div>
- </td>
- </tr>
- <tr id="i64" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#main(java.lang.String%5B%5D)">main</a></span>​(java.lang.String[] args)</code></th>
- <td class="colLast">
- <div class="block">Prints the version number and the copyright notice.</div>
- </td>
- </tr>
- <tr id="i65" class="rowColor">
- <td class="colFirst"><code><a href="CtConstructor.html" title="class in javassist">CtConstructor</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#makeClassInitializer()">makeClassInitializer</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Makes an empty class initializer (static constructor).</div>
- </td>
- </tr>
- <tr id="i66" class="altColor">
- <td class="colFirst"><code><a href="CtClass.html" title="class in javassist">CtClass</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#makeNestedClass(java.lang.String,boolean)">makeNestedClass</a></span>​(java.lang.String name,
- boolean isStatic)</code></th>
- <td class="colLast">
- <div class="block">Makes a new public nested class.</div>
- </td>
- </tr>
- <tr id="i67" class="rowColor">
- <td class="colFirst"><code>java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#makeUniqueName(java.lang.String)">makeUniqueName</a></span>​(java.lang.String prefix)</code></th>
- <td class="colLast">
- <div class="block">Makes a unique member name.</div>
- </td>
- </tr>
- <tr id="i68" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#prune()">prune</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Discards unnecessary attributes, in particular,
- <code>CodeAttribute</code>s (method bodies) of the class,
- to minimize the memory footprint.</div>
- </td>
- </tr>
- <tr id="i69" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#rebuildClassFile()">rebuildClassFile</a></span>()</code></th>
- <td class="colLast">
- <div class="block">If this method is called, the class file will be
- rebuilt when it is finally generated by
- <code>toBytecode()</code> and <code>writeFile()</code>.</div>
- </td>
- </tr>
- <tr id="i70" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeConstructor(javassist.CtConstructor)">removeConstructor</a></span>​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> c)</code></th>
- <td class="colLast">
- <div class="block">Removes a constructor declared in this class.</div>
- </td>
- </tr>
- <tr id="i71" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeField(javassist.CtField)">removeField</a></span>​(<a href="CtField.html" title="class in javassist">CtField</a> f)</code></th>
- <td class="colLast">
- <div class="block">Removes a field declared in this class.</div>
- </td>
- </tr>
- <tr id="i72" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeMethod(javassist.CtMethod)">removeMethod</a></span>​(<a href="CtMethod.html" title="class in javassist">CtMethod</a> m)</code></th>
- <td class="colLast">
- <div class="block">Removes a method declared in this class.</div>
- </td>
- </tr>
- <tr id="i73" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replaceClassName(java.lang.String,java.lang.String)">replaceClassName</a></span>​(java.lang.String oldName,
- java.lang.String newName)</code></th>
- <td class="colLast">
- <div class="block">Substitutes <code>newName</code> for all occurrences of a class
- name <code>oldName</code> in the class file.</div>
- </td>
- </tr>
- <tr id="i74" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replaceClassName(javassist.ClassMap)">replaceClassName</a></span>​(<a href="ClassMap.html" title="class in javassist">ClassMap</a> map)</code></th>
- <td class="colLast">
- <div class="block">Changes class names appearing in the class file according to the
- given <code>map</code>.</div>
- </td>
- </tr>
- <tr id="i75" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAttribute(java.lang.String,byte%5B%5D)">setAttribute</a></span>​(java.lang.String name,
- byte[] data)</code></th>
- <td class="colLast">
- <div class="block">Adds a named attribute.</div>
- </td>
- </tr>
- <tr id="i76" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setGenericSignature(java.lang.String)">setGenericSignature</a></span>​(java.lang.String sig)</code></th>
- <td class="colLast">
- <div class="block">Sets the generic signature of the class.</div>
- </td>
- </tr>
- <tr id="i77" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setInterfaces(javassist.CtClass%5B%5D)">setInterfaces</a></span>​(<a href="CtClass.html" title="class in javassist">CtClass</a>[] list)</code></th>
- <td class="colLast">
- <div class="block">Sets implemented interfaces.</div>
- </td>
- </tr>
- <tr id="i78" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setModifiers(int)">setModifiers</a></span>​(int mod)</code></th>
- <td class="colLast">
- <div class="block">Sets the modifiers.</div>
- </td>
- </tr>
- <tr id="i79" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setName(java.lang.String)">setName</a></span>​(java.lang.String name)</code></th>
- <td class="colLast">
- <div class="block">Sets the class name</div>
- </td>
- </tr>
- <tr id="i80" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSuperclass(javassist.CtClass)">setSuperclass</a></span>​(<a href="CtClass.html" title="class in javassist">CtClass</a> clazz)</code></th>
- <td class="colLast">
- <div class="block">Changes a super class unless this object represents an interface.</div>
- </td>
- </tr>
- <tr id="i81" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#stopPruning(boolean)">stopPruning</a></span>​(boolean stop)</code></th>
- <td class="colLast">
- <div class="block">Disallows (or allows) automatically pruning this <code>CtClass</code>
- object.</div>
- </td>
- </tr>
- <tr id="i82" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subclassOf(javassist.CtClass)">subclassOf</a></span>​(<a href="CtClass.html" title="class in javassist">CtClass</a> superclass)</code></th>
- <td class="colLast">
- <div class="block">Determines whether the class directly or indirectly extends
- the given class.</div>
- </td>
- </tr>
- <tr id="i83" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subtypeOf(javassist.CtClass)">subtypeOf</a></span>​(<a href="CtClass.html" title="class in javassist">CtClass</a> clazz)</code></th>
- <td class="colLast">
- <div class="block">Returns <code>true</code> if this class extends or implements
- <code>clazz</code>.</div>
- </td>
- </tr>
- <tr id="i84" class="altColor">
- <td class="colFirst"><code>byte[]</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBytecode()">toBytecode</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Converts this class to a class file.</div>
- </td>
- </tr>
- <tr id="i85" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBytecode(java.io.DataOutputStream)">toBytecode</a></span>​(java.io.DataOutputStream out)</code></th>
- <td class="colLast">
- <div class="block">Converts this class to a class file.</div>
- </td>
- </tr>
- <tr id="i86" class="altColor">
- <td class="colFirst"><code>java.lang.Class<?></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toClass()">toClass</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.</div>
- </td>
- </tr>
- <tr id="i87" class="rowColor">
- <td class="colFirst"><code>java.lang.Class<?></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toClass(java.lang.Class)">toClass</a></span>​(java.lang.Class<?> neighbor)</code></th>
- <td class="colLast">
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.</div>
- </td>
- </tr>
- <tr id="i88" class="altColor">
- <td class="colFirst"><code>java.lang.Class<?></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toClass(java.lang.ClassLoader)">toClass</a></span>​(java.lang.ClassLoader loader)</code></th>
- <td class="colLast">
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="deprecationComment">Replaced by <a href="#toClass(java.lang.ClassLoader,java.security.ProtectionDomain)"><code>toClass(ClassLoader,ProtectionDomain)</code></a></div>
- </div>
- </td>
- </tr>
- <tr id="i89" class="rowColor">
- <td class="colFirst"><code>java.lang.Class<?></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toClass(java.lang.ClassLoader,java.security.ProtectionDomain)">toClass</a></span>​(java.lang.ClassLoader loader,
- java.security.ProtectionDomain domain)</code></th>
- <td class="colLast">
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.</div>
- </td>
- </tr>
- <tr id="i90" class="altColor">
- <td class="colFirst"><code>java.lang.Class<?></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toClass(java.lang.invoke.MethodHandles.Lookup)">toClass</a></span>​(java.lang.invoke.MethodHandles.Lookup lookup)</code></th>
- <td class="colLast">
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.</div>
- </td>
- </tr>
- <tr id="i91" class="rowColor">
- <td class="colFirst"><code>java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Converts the object to a string.</div>
- </td>
- </tr>
- <tr id="i92" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeFile()">writeFile</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Writes a class file represented by this <code>CtClass</code>
- object in the current directory.</div>
- </td>
- </tr>
- <tr id="i93" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeFile(java.lang.String)">writeFile</a></span>​(java.lang.String directoryName)</code></th>
- <td class="colLast">
- <div class="block">Writes a class file represented by this <code>CtClass</code>
- object on a local disk.</div>
- </td>
- </tr>
- </table>
- <ul class="blockList">
- <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
- <!-- -->
- </a>
- <h3>Methods inherited from class 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">
- <!-- ============ FIELD DETAIL =========== -->
- <section role="region">
- <ul class="blockList">
- <li class="blockList"><a id="field.detail">
- <!-- -->
- </a>
- <h3>Field Detail</h3>
- <a id="debugDump">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>debugDump</h4>
- <pre>public static java.lang.String debugDump</pre>
- <div class="block">If the value of this field is not null, then all class
- files modified by Javassist are saved under the directory
- specified by this variable. For example, if the value is
- <code>"./debug"</code>, then all class files are saved
- there. The directory name must not end with a directory
- separator such as <code>/</code>.
-
- <p>The default value is null.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.16</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#debugWriteFile(java.lang.String)"><code>debugWriteFile(String)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="version">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>version</h4>
- <pre>public static final java.lang.String version</pre>
- <div class="block">The version number of this release.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../constant-values.html#javassist.CtClass.version">Constant Field Values</a></dd>
- </dl>
- </li>
- </ul>
- <a id="booleanType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>booleanType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> booleanType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>boolean</code> type.</div>
- </li>
- </ul>
- <a id="charType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>charType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> charType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>char</code> type.</div>
- </li>
- </ul>
- <a id="byteType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>byteType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> byteType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>byte</code> type.</div>
- </li>
- </ul>
- <a id="shortType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>shortType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> shortType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>short</code> type.</div>
- </li>
- </ul>
- <a id="intType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>intType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> intType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>int</code> type.</div>
- </li>
- </ul>
- <a id="longType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>longType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> longType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>long</code> type.</div>
- </li>
- </ul>
- <a id="floatType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>floatType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> floatType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>float</code> type.</div>
- </li>
- </ul>
- <a id="doubleType">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>doubleType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> doubleType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>double</code> type.</div>
- </li>
- </ul>
- <a id="voidType">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>voidType</h4>
- <pre>public static <a href="CtClass.html" title="class in javassist">CtClass</a> voidType</pre>
- <div class="block">The <code>CtClass</code> object representing
- the <code>void</code> type.</div>
- </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="main(java.lang.String[])">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>main</h4>
- <pre class="methodSignature">public static void main​(java.lang.String[] args)</pre>
- <div class="block">Prints the version number and the copyright notice.
-
- <p>The following command invokes this method:
-
- <pre>java -jar javassist.jar</pre></div>
- </li>
- </ul>
- <a id="toString()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toString</h4>
- <pre class="methodSignature">public java.lang.String toString()</pre>
- <div class="block">Converts the object to a string.</div>
- <dl>
- <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
- <dd><code>toString</code> in class <code>java.lang.Object</code></dd>
- </dl>
- </li>
- </ul>
- <a id="getClassPool()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getClassPool</h4>
- <pre class="methodSignature">public <a href="ClassPool.html" title="class in javassist">ClassPool</a> getClassPool()</pre>
- <div class="block">Returns a <code>ClassPool</code> for this class.</div>
- </li>
- </ul>
- <a id="getClassFile()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getClassFile</h4>
- <pre class="methodSignature">public <a href="bytecode/ClassFile.html" title="class in javassist.bytecode">ClassFile</a> getClassFile()</pre>
- <div class="block">Returns a class file for this class.
-
- <p>This method is not available if <code>isFrozen()</code>
- is true.</div>
- </li>
- </ul>
- <a id="getClassFile2()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getClassFile2</h4>
- <pre class="methodSignature">public <a href="bytecode/ClassFile.html" title="class in javassist.bytecode">ClassFile</a> getClassFile2()</pre>
- <div class="block">Returns a class file for this class (read only).
- Normal applications do not need calling this method. Use
- <code>getClassFile()</code>.
-
- <p>The <code>ClassFile</code> object obtained by this method
- is read only. Changes to this object might not be reflected
- on a class file generated by <code>toBytecode()</code>,
- <code>toClass()</code>, etc.
-
- <p>This method is available even if <code>isFrozen()</code>
- is true. However, if the class is frozen, it might be also
- pruned.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#getClassFile()"><code>getClassFile()</code></a>,
- <a href="#isFrozen()"><code>isFrozen()</code></a>,
- <a href="#prune()"><code>prune()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getAccessorMaker()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getAccessorMaker</h4>
- <pre class="methodSignature">public javassist.compiler.AccessorMaker getAccessorMaker()</pre>
- <div class="block">Undocumented method. Do not use; internal-use only.</div>
- </li>
- </ul>
- <a id="getURL()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getURL</h4>
- <pre class="methodSignature">public java.net.URL getURL()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns the uniform resource locator (URL) of the class file.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="isModified()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isModified</h4>
- <pre class="methodSignature">public boolean isModified()</pre>
- <div class="block">Returns true if the definition of the class has been modified.</div>
- </li>
- </ul>
- <a id="isFrozen()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isFrozen</h4>
- <pre class="methodSignature">public boolean isFrozen()</pre>
- <div class="block">Returns true if the class has been loaded or written out
- and thus it cannot be modified any more.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#defrost()"><code>defrost()</code></a>,
- <a href="#detach()"><code>detach()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="freeze()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>freeze</h4>
- <pre class="methodSignature">public void freeze()</pre>
- <div class="block">Makes the class frozen.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.6</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#isFrozen()"><code>isFrozen()</code></a>,
- <a href="#defrost()"><code>defrost()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="defrost()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>defrost</h4>
- <pre class="methodSignature">public void defrost()</pre>
- <div class="block">Defrosts the class so that the class can be modified again.
-
- <p>To avoid changes that will be never reflected,
- the class is frozen to be unmodifiable if it is loaded or
- written out. This method should be called only in a case
- that the class will be reloaded or written out later again.
-
- <p>If <code>defrost()</code> will be called later, pruning
- must be disallowed in advance.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#isFrozen()"><code>isFrozen()</code></a>,
- <a href="#stopPruning(boolean)"><code>stopPruning(boolean)</code></a>,
- <a href="#detach()"><code>detach()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="isPrimitive()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isPrimitive</h4>
- <pre class="methodSignature">public boolean isPrimitive()</pre>
- <div class="block">Returns <code>true</code> if this object represents a primitive
- Java type: boolean, byte, char, short, int, long, float, double,
- or void.</div>
- </li>
- </ul>
- <a id="isArray()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isArray</h4>
- <pre class="methodSignature">public boolean isArray()</pre>
- <div class="block">Returns <code>true</code> if this object represents an array type.</div>
- </li>
- </ul>
- <a id="isKotlin()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isKotlin</h4>
- <pre class="methodSignature">public boolean isKotlin()</pre>
- <div class="block">Returns <code>true</code> if this object represents a Kotlin class.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.26</dd>
- </dl>
- </li>
- </ul>
- <a id="getComponentType()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getComponentType</h4>
- <pre class="methodSignature">public <a href="CtClass.html" title="class in javassist">CtClass</a> getComponentType()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">If this object represents an array, this method returns the component
- type of the array. Otherwise, it returns <code>null</code>.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="subtypeOf(javassist.CtClass)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>subtypeOf</h4>
- <pre class="methodSignature">public boolean subtypeOf​(<a href="CtClass.html" title="class in javassist">CtClass</a> clazz)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns <code>true</code> if this class extends or implements
- <code>clazz</code>. It also returns <code>true</code> if
- this class is the same as <code>clazz</code>.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="getName()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getName</h4>
- <pre class="methodSignature">public java.lang.String getName()</pre>
- <div class="block">Obtains the fully-qualified name of the class.</div>
- </li>
- </ul>
- <a id="getSimpleName()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getSimpleName</h4>
- <pre class="methodSignature">public final java.lang.String getSimpleName()</pre>
- <div class="block">Obtains the not-qualified class name.</div>
- </li>
- </ul>
- <a id="getPackageName()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getPackageName</h4>
- <pre class="methodSignature">public final java.lang.String getPackageName()</pre>
- <div class="block">Obtains the package name. It may be <code>null</code>.</div>
- </li>
- </ul>
- <a id="setName(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setName</h4>
- <pre class="methodSignature">public void setName​(java.lang.String name)</pre>
- <div class="block">Sets the class name</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - fully-qualified name</dd>
- </dl>
- </li>
- </ul>
- <a id="getGenericSignature()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getGenericSignature</h4>
- <pre class="methodSignature">public java.lang.String getGenericSignature()</pre>
- <div class="block">Returns the generic signature of the class.
-
- <p>The generics of Java is implemented by the erasure technique.
- After compilation, all type parameters are dropped off from the
- main part of a class file. However, for reflection, the type
- parameters are encoded into generic signatures and attached
- to a class file.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>null if the generic signature is not included.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.17</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="bytecode/SignatureAttribute.html#toClassSignature(java.lang.String)"><code>SignatureAttribute.toClassSignature(String)</code></a>,
- <a href="CtMember.html#getGenericSignature()"><code>CtMember.getGenericSignature()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="setGenericSignature(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setGenericSignature</h4>
- <pre class="methodSignature">public void setGenericSignature​(java.lang.String sig)</pre>
- <div class="block">Sets the generic signature of the class.
-
- <p>The generics of Java is implemented by the erasure technique.
- After compilation, all type parameters are dropped off from the
- main part of a class file. However, for reflection, the type
- parameters must be encoded into generic signatures and attached
- to a class file.
-
- <p>For example,
-
- <pre>class List<T> {
- T value;
- T get() { return value; }
- void set(T v) { value = v; }
- }
- </pre>
-
- <p>this class is generated by the following code:
-
- <pre>
- ClassPool pool = ClassPool.getDefault();
- CtClass cc = pool.makeClass("List");
- CtClass objectClass = pool.get(CtClass.javaLangObject);
- ClassSignature cs = new ClassSignature(
- new TypeParameter[] { new TypeParameter("T") });
- cc.setGenericSignature(cs.encode()); // <T:Ljava/lang/Object;>Ljava/lang/Object;
-
- CtField f = new CtField(objClass, "value", cc);
- TypeVariable tvar = new TypeVariable("T");
- f.setGenericSignature(tvar.encode()); // TT;
- cc.addField(f);
-
- CtMethod m = CtNewMethod.make("public Object get(){return value;}", cc);
- MethodSignature ms = new MethodSignature(null, null, tvar, null);
- m.setGenericSignature(ms.encode()); // ()TT;
- cc.addMethod(m);
-
- CtMethod m2 = CtNewMethod.make("public void set(Object v){value = v;}", cc);
- MethodSignature ms2 = new MethodSignature(null, new Type[] { tvar },
- new BaseType("void"), null);
- m2.setGenericSignature(ms2.encode()); // (TT;)V;
- cc.addMethod(m2);
-
- cc.writeFile();
- </pre>
-
- <p>The generated class file is equivalent to the following:
-
- <pre>class List {
- Object value;
- Object get() { return value; }
- void set(Object v) { value = v; }
- }</pre>
-
- <p>but it includes generic signatures for the class, the field,
- and the methods so that the type variable <code>T</code> can be
- accessible through reflection.
-
- <p><code>MethodSignature</code> is a utility class. You can directly
- pass the signature string to the <code>setGenericSignature</code> method.
- For the specification of the signatures, see Section 4.7.9.1 <i>Signatures</i>
- of The Java Virtual Machine Specification (Java SE 8).</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>sig</code> - a generic signature.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.17</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="bytecode/SignatureAttribute.ClassSignature.html#encode()"><code>SignatureAttribute.ClassSignature.encode()</code></a>,
- <a href="bytecode/SignatureAttribute.MethodSignature.html#encode()"><code>SignatureAttribute.MethodSignature.encode()</code></a>,
- <a href="CtMember.html#setGenericSignature(java.lang.String)"><code>CtMember.setGenericSignature(String)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="replaceClassName(java.lang.String,java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>replaceClassName</h4>
- <pre class="methodSignature">public void replaceClassName​(java.lang.String oldName,
- java.lang.String newName)</pre>
- <div class="block">Substitutes <code>newName</code> for all occurrences of a class
- name <code>oldName</code> in the class file.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>oldName</code> - replaced class name</dd>
- <dd><code>newName</code> - substituted class name</dd>
- </dl>
- </li>
- </ul>
- <a id="replaceClassName(javassist.ClassMap)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>replaceClassName</h4>
- <pre class="methodSignature">public void replaceClassName​(<a href="ClassMap.html" title="class in javassist">ClassMap</a> map)</pre>
- <div class="block">Changes class names appearing in the class file according to the
- given <code>map</code>.
-
- <p>All the class names appearing in the class file are tested
- with <code>map</code> to determine whether each class name is
- replaced or not. Thus this method can be used for collecting
- all the class names in the class file. To do that, first define
- a subclass of <code>ClassMap</code> so that <code>get()</code>
- records all the given parameters. Then, make an instance of
- that subclass as an empty hash-table. Finally, pass that instance
- to this method. After this method finishes, that instance would
- contain all the class names appearing in the class file.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>map</code> - the hashtable associating replaced class names
- with substituted names.</dd>
- </dl>
- </li>
- </ul>
- <a id="getRefClasses()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getRefClasses</h4>
- <pre class="methodSignature">public java.util.Collection<java.lang.String> getRefClasses()</pre>
- <div class="block">Returns a collection of the names of all the classes
- referenced in this class.
- That collection includes the name of this class.
-
- <p>This method may return <code>null</code>.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a <code>Collection<String></code> object.</dd>
- </dl>
- </li>
- </ul>
- <a id="isInterface()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isInterface</h4>
- <pre class="methodSignature">public boolean isInterface()</pre>
- <div class="block">Determines whether this object represents a class or an interface.
- It returns <code>true</code> if this object represents an interface.</div>
- </li>
- </ul>
- <a id="isAnnotation()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isAnnotation</h4>
- <pre class="methodSignature">public boolean isAnnotation()</pre>
- <div class="block">Determines whether this object represents an annotation type.
- It returns <code>true</code> if this object represents an annotation type.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.2</dd>
- </dl>
- </li>
- </ul>
- <a id="isEnum()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isEnum</h4>
- <pre class="methodSignature">public boolean isEnum()</pre>
- <div class="block">Determines whether this object represents an enum.
- It returns <code>true</code> if this object represents an enum.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.2</dd>
- </dl>
- </li>
- </ul>
- <a id="getModifiers()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getModifiers</h4>
- <pre class="methodSignature">public int getModifiers()</pre>
- <div class="block">Returns the modifiers for this class, encoded in an integer.
- For decoding, use <code>javassist.Modifier</code>.
-
- <p>If the class is a static nested class (a.k.a. static inner class),
- the returned modifiers include <code>Modifier.STATIC</code>.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="Modifier.html" title="class in javassist"><code>Modifier</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="hasAnnotation(java.lang.Class)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>hasAnnotation</h4>
- <pre class="methodSignature">public boolean hasAnnotation​(java.lang.Class<?> annotationType)</pre>
- <div class="block">Returns true if the class has the specified annotation type.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>annotationType</code> - the annotation type.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd><code>true</code> if the annotation is found, otherwise <code>false</code>.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.11</dd>
- </dl>
- </li>
- </ul>
- <a id="hasAnnotation(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>hasAnnotation</h4>
- <pre class="methodSignature">public boolean hasAnnotation​(java.lang.String annotationTypeName)</pre>
- <div class="block">Returns true if the class has the specified annotation type.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>annotationTypeName</code> - the name of annotation type.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd><code>true</code> if the annotation is found, otherwise <code>false</code>.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.21</dd>
- </dl>
- </li>
- </ul>
- <a id="getAnnotation(java.lang.Class)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getAnnotation</h4>
- <pre class="methodSignature">public java.lang.Object getAnnotation​(java.lang.Class<?> clz)
- throws java.lang.ClassNotFoundException</pre>
- <div class="block">Returns the annotation if the class has the specified annotation type.
- For example, if an annotation <code>@Author</code> is associated
- with this class, an <code>Author</code> object is returned.
- The member values can be obtained by calling methods on
- the <code>Author</code> object.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>clz</code> - the annotation type.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the annotation if found, otherwise <code>null</code>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code>java.lang.ClassNotFoundException</code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.11</dd>
- </dl>
- </li>
- </ul>
- <a id="getAnnotations()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getAnnotations</h4>
- <pre class="methodSignature">public java.lang.Object[] getAnnotations()
- throws java.lang.ClassNotFoundException</pre>
- <div class="block">Returns the annotations associated with this class.
- For example, if an annotation <code>@Author</code> is associated
- with this class, the returned array contains an <code>Author</code>
- object. The member values can be obtained by calling methods on
- the <code>Author</code> object.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an array of annotation-type objects.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code>java.lang.ClassNotFoundException</code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.1</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtMember.html#getAnnotations()"><code>CtMember.getAnnotations()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getAvailableAnnotations()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getAvailableAnnotations</h4>
- <pre class="methodSignature">public java.lang.Object[] getAvailableAnnotations()</pre>
- <div class="block">Returns the annotations associated with this class.
- This method is equivalent to <code>getAnnotations()</code>
- except that, if any annotations are not on the classpath,
- they are not included in the returned array.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an array of annotation-type objects.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.3</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#getAnnotations()"><code>getAnnotations()</code></a>,
- <a href="CtMember.html#getAvailableAnnotations()"><code>CtMember.getAvailableAnnotations()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredClasses()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredClasses</h4>
- <pre class="methodSignature">public <a href="CtClass.html" title="class in javassist">CtClass</a>[] getDeclaredClasses()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns an array of nested classes declared in the class.
- Nested classes are inner classes, anonymous classes, local classes,
- and static nested classes. This simply calls <code>getNestedClasses()</code>.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.15</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#getNestedClasses()"><code>getNestedClasses()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getNestedClasses()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getNestedClasses</h4>
- <pre class="methodSignature">public <a href="CtClass.html" title="class in javassist">CtClass</a>[] getNestedClasses()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns an array of nested classes declared in the class.
- Nested classes are inner classes, anonymous classes, local classes,
- and static nested classes.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.2</dd>
- </dl>
- </li>
- </ul>
- <a id="setModifiers(int)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setModifiers</h4>
- <pre class="methodSignature">public void setModifiers​(int mod)</pre>
- <div class="block">Sets the modifiers.
-
- <p>If the class is a nested class, this method also modifies
- the class declaring that nested class (i.e. the enclosing
- class is modified).</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>mod</code> - modifiers encoded by
- <code>javassist.Modifier</code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="Modifier.html" title="class in javassist"><code>Modifier</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="subclassOf(javassist.CtClass)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>subclassOf</h4>
- <pre class="methodSignature">public boolean subclassOf​(<a href="CtClass.html" title="class in javassist">CtClass</a> superclass)</pre>
- <div class="block">Determines whether the class directly or indirectly extends
- the given class. If this class extends a class A and
- the class A extends a class B, then subclassof(B) returns true.
-
- <p>This method returns true if the given class is identical to
- the class represented by this object.</div>
- </li>
- </ul>
- <a id="getSuperclass()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getSuperclass</h4>
- <pre class="methodSignature">public <a href="CtClass.html" title="class in javassist">CtClass</a> getSuperclass()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Obtains the class object representing the superclass of the
- class.
- It returns null if this object represents the
- <code>java.lang.Object</code> class and thus it does not have
- the super class.
-
- <p>If this object represents an interface, this method
- always returns the <code>java.lang.Object</code> class.
- To obtain the super interfaces
- extended by that interface, call <code>getInterfaces()</code>.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="setSuperclass(javassist.CtClass)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setSuperclass</h4>
- <pre class="methodSignature">public void setSuperclass​(<a href="CtClass.html" title="class in javassist">CtClass</a> clazz)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Changes a super class unless this object represents an interface.
- The new super class must be compatible with the old one; for example,
- it should inherit from the old super class.
-
- <p>If this object represents an interface, this method is equivalent
- to <code>addInterface()</code>; it appends <code>clazz</code> to
- the list of the super interfaces extended by that interface.
- Note that an interface can extend multiple super interfaces.</div>
- <dl>
- <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="#replaceClassName(java.lang.String,java.lang.String)"><code>replaceClassName(String, String)</code></a>,
- <a href="#replaceClassName(javassist.ClassMap)"><code>replaceClassName(ClassMap)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getInterfaces()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getInterfaces</h4>
- <pre class="methodSignature">public <a href="CtClass.html" title="class in javassist">CtClass</a>[] getInterfaces()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Obtains the class objects representing the interfaces implemented
- by the class or, if this object represents an interface, the interfaces
- extended by that interface.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="setInterfaces(javassist.CtClass[])">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setInterfaces</h4>
- <pre class="methodSignature">public void setInterfaces​(<a href="CtClass.html" title="class in javassist">CtClass</a>[] list)</pre>
- <div class="block">Sets implemented interfaces. If this object represents an interface,
- this method sets the interfaces extended by that interface.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>list</code> - a list of the <code>CtClass</code> objects
- representing interfaces, or
- <code>null</code> if the class implements
- no interfaces.</dd>
- </dl>
- </li>
- </ul>
- <a id="addInterface(javassist.CtClass)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>addInterface</h4>
- <pre class="methodSignature">public void addInterface​(<a href="CtClass.html" title="class in javassist">CtClass</a> anInterface)</pre>
- <div class="block">Adds an interface.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>anInterface</code> - the added interface.</dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaringClass()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaringClass</h4>
- <pre class="methodSignature">public <a href="CtClass.html" title="class in javassist">CtClass</a> getDeclaringClass()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">If this class is a member class or interface of another class,
- then the class enclosing this class is returned.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>null if this class is a top-level class or an anonymous class.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="getEnclosingMethod()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getEnclosingMethod</h4>
- <pre class="methodSignature">@Deprecated
- public final <a href="CtMethod.html" title="class in javassist">CtMethod</a> getEnclosingMethod()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
- <div class="deprecationComment">The enclosing method might be a constructor.
- Use <a href="#getEnclosingBehavior()"><code>getEnclosingBehavior()</code></a>.</div>
- </div>
- <div class="block">Returns the immediately enclosing method of this class.
- This method works only with JDK 1.5 or later.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>null if this class is not a local class or an anonymous
- class.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#getEnclosingBehavior()"><code>getEnclosingBehavior()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getEnclosingBehavior()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getEnclosingBehavior</h4>
- <pre class="methodSignature">public <a href="CtBehavior.html" title="class in javassist">CtBehavior</a> getEnclosingBehavior()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns the immediately enclosing method of this class.
- It might be not a method but a constructor.
- This method works only with JDK 1.5 or later.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>null if this class is not a local class or an anonymous
- class.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="makeNestedClass(java.lang.String,boolean)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>makeNestedClass</h4>
- <pre class="methodSignature">public <a href="CtClass.html" title="class in javassist">CtClass</a> makeNestedClass​(java.lang.String name,
- boolean isStatic)</pre>
- <div class="block">Makes a new public nested class. If this method is called,
- the <code>CtClass</code>, which encloses the nested class, is modified
- since a class file includes a list of nested classes.
-
- <p>The current implementation only supports a static nested class.
- <code>isStatic</code> must be true.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - the simple name of the nested class.</dd>
- <dd><code>isStatic</code> - true if the nested class is static.</dd>
- </dl>
- </li>
- </ul>
- <a id="getFields()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getFields</h4>
- <pre class="methodSignature">public <a href="CtField.html" title="class in javassist">CtField</a>[] getFields()</pre>
- <div class="block">Returns an array containing <code>CtField</code> objects
- representing all the non-private fields of the class.
- That array includes non-private fields inherited from the
- superclasses.</div>
- </li>
- </ul>
- <a id="getField(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getField</h4>
- <pre class="methodSignature">public <a href="CtField.html" title="class in javassist">CtField</a> getField​(java.lang.String name)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns the field with the specified name. The returned field
- may be a private field declared in a super class or interface.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="getField(java.lang.String,java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getField</h4>
- <pre class="methodSignature">public <a href="CtField.html" title="class in javassist">CtField</a> getField​(java.lang.String name,
- java.lang.String desc)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns the field with the specified name and type. The returned field
- may be a private field declared in a super class or interface.
- Unlike Java, the JVM allows a class to have
- multiple fields with the same name but different types.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - the field name.</dd>
- <dd><code>desc</code> - the type descriptor of the field. It is available by
- <a href="CtField.html#getSignature()"><code>CtField.getSignature()</code></a>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtField.html#getSignature()"><code>CtField.getSignature()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredFields()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredFields</h4>
- <pre class="methodSignature">public <a href="CtField.html" title="class in javassist">CtField</a>[] getDeclaredFields()</pre>
- <div class="block">Gets all the fields declared in the class. The inherited fields
- are not included.
-
- <p>Note: the result does not include inherited fields.</div>
- </li>
- </ul>
- <a id="getDeclaredField(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredField</h4>
- <pre class="methodSignature">public <a href="CtField.html" title="class in javassist">CtField</a> getDeclaredField​(java.lang.String name)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Retrieves the field with the specified name among the fields
- declared in the class.
-
- <p>Note: this method does not search the super classes.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredField(java.lang.String,java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredField</h4>
- <pre class="methodSignature">public <a href="CtField.html" title="class in javassist">CtField</a> getDeclaredField​(java.lang.String name,
- java.lang.String desc)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Retrieves the field with the specified name and type among the fields
- declared in the class. Unlike Java, the JVM allows a class to have
- multiple fields with the same name but different types.
-
- <p>Note: this method does not search the super classes.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - the field name.</dd>
- <dd><code>desc</code> - the type descriptor of the field. It is available by
- <a href="CtField.html#getSignature()"><code>CtField.getSignature()</code></a>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtField.html#getSignature()"><code>CtField.getSignature()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredBehaviors()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredBehaviors</h4>
- <pre class="methodSignature">public <a href="CtBehavior.html" title="class in javassist">CtBehavior</a>[] getDeclaredBehaviors()</pre>
- <div class="block">Gets all the constructors and methods declared in the class.</div>
- </li>
- </ul>
- <a id="getConstructors()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getConstructors</h4>
- <pre class="methodSignature">public <a href="CtConstructor.html" title="class in javassist">CtConstructor</a>[] getConstructors()</pre>
- <div class="block">Returns an array containing <code>CtConstructor</code> objects
- representing all the non-private constructors of the class.</div>
- </li>
- </ul>
- <a id="getConstructor(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getConstructor</h4>
- <pre class="methodSignature">public <a href="CtConstructor.html" title="class in javassist">CtConstructor</a> getConstructor​(java.lang.String desc)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns the constructor with the given signature,
- which is represented by a character string
- called method descriptor.
- For details of the method descriptor, see the JVM specification
- or <code>javassist.bytecode.Descriptor</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>desc</code> - method descriptor</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="bytecode/Descriptor.html" title="class in javassist.bytecode"><code>Descriptor</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredConstructors()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredConstructors</h4>
- <pre class="methodSignature">public <a href="CtConstructor.html" title="class in javassist">CtConstructor</a>[] getDeclaredConstructors()</pre>
- <div class="block">Gets all the constructors declared in the class.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtConstructor.html" title="class in javassist"><code>CtConstructor</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredConstructor(javassist.CtClass[])">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredConstructor</h4>
- <pre class="methodSignature">public <a href="CtConstructor.html" title="class in javassist">CtConstructor</a> getDeclaredConstructor​(<a href="CtClass.html" title="class in javassist">CtClass</a>[] params)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns a constructor receiving the specified parameters.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>params</code> - parameter types.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="getClassInitializer()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getClassInitializer</h4>
- <pre class="methodSignature">public <a href="CtConstructor.html" title="class in javassist">CtConstructor</a> getClassInitializer()</pre>
- <div class="block">Gets the class initializer (static constructor)
- declared in the class.
- This method returns <code>null</code> if
- no class initializer is not declared.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#makeClassInitializer()"><code>makeClassInitializer()</code></a>,
- <a href="CtConstructor.html" title="class in javassist"><code>CtConstructor</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getMethods()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getMethods</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a>[] getMethods()</pre>
- <div class="block">Returns an array containing <code>CtMethod</code> objects
- representing all the non-private methods of the class.
- That array includes non-private methods inherited from the
- superclasses.</div>
- </li>
- </ul>
- <a id="getMethod(java.lang.String,java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getMethod</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a> getMethod​(java.lang.String name,
- java.lang.String desc)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Returns the method with the given name and signature.
- The returned method may be declared in a super class.
- The method signature is represented by a character string
- called method descriptor,
- which is defined in the JVM specification.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - method name</dd>
- <dd><code>desc</code> - method descriptor</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtBehavior.html#getSignature()"><code>CtBehavior.getSignature()</code></a>,
- <a href="bytecode/Descriptor.html" title="class in javassist.bytecode"><code>Descriptor</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredMethods()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredMethods</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a>[] getDeclaredMethods()</pre>
- <div class="block">Gets all methods declared in the class. The inherited methods
- are not included.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtMethod.html" title="class in javassist"><code>CtMethod</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredMethod(java.lang.String,javassist.CtClass[])">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredMethod</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a> getDeclaredMethod​(java.lang.String name,
- <a href="CtClass.html" title="class in javassist">CtClass</a>[] params)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Retrieves the method with the specified name and parameter types
- among the methods declared in the class.
-
- <p>Note: this method does not search the superclasses.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - method name</dd>
- <dd><code>params</code> - parameter types</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtMethod.html" title="class in javassist"><code>CtMethod</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredMethods(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredMethods</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a>[] getDeclaredMethods​(java.lang.String name)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Retrieves methods with the specified name among the methods
- declared in the class. Multiple methods with different parameters
- may be returned.
-
- <p>Note: this method does not search the superclasses.</p></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - method name.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.19</dd>
- </dl>
- </li>
- </ul>
- <a id="getDeclaredMethod(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDeclaredMethod</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a> getDeclaredMethod​(java.lang.String name)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Retrieves the method with the specified name among the methods
- declared in the class. If there are multiple methods with
- the specified name, then this method returns one of them.
-
- <p>Note: this method does not search the superclasses.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtMethod.html" title="class in javassist"><code>CtMethod</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="makeClassInitializer()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>makeClassInitializer</h4>
- <pre class="methodSignature">public <a href="CtConstructor.html" title="class in javassist">CtConstructor</a> makeClassInitializer()
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Makes an empty class initializer (static constructor).
- If the class already includes a class initializer,
- this method returns it.</div>
- <dl>
- <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="#getClassInitializer()"><code>getClassInitializer()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="addConstructor(javassist.CtConstructor)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>addConstructor</h4>
- <pre class="methodSignature">public void addConstructor​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> c)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Adds a constructor. To add a class initializer (static constructor),
- call <code>makeClassInitializer()</code>.</div>
- <dl>
- <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="#makeClassInitializer()"><code>makeClassInitializer()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="removeConstructor(javassist.CtConstructor)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>removeConstructor</h4>
- <pre class="methodSignature">public void removeConstructor​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> c)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Removes a constructor declared in this class.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>c</code> - removed constructor.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code> - if the constructor is not found.</dd>
- </dl>
- </li>
- </ul>
- <a id="addMethod(javassist.CtMethod)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>addMethod</h4>
- <pre class="methodSignature">public void addMethod​(<a href="CtMethod.html" title="class in javassist">CtMethod</a> m)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Adds a method.</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="removeMethod(javassist.CtMethod)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>removeMethod</h4>
- <pre class="methodSignature">public void removeMethod​(<a href="CtMethod.html" title="class in javassist">CtMethod</a> m)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Removes a method declared in this class.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>m</code> - removed method.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code> - if the method is not found.</dd>
- </dl>
- </li>
- </ul>
- <a id="addField(javassist.CtField)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>addField</h4>
- <pre class="methodSignature">public void addField​(<a href="CtField.html" title="class in javassist">CtField</a> f)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Adds a field.
-
- <p>The <code>CtField</code> belonging to another
- <code>CtClass</code> cannot be directly added to this class.
- Only a field created for this class can be added.</div>
- <dl>
- <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="CtField.html#%3Cinit%3E(javassist.CtField,javassist.CtClass)"><code>CtField(CtField,CtClass)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="addField(javassist.CtField,java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>addField</h4>
- <pre class="methodSignature">public void addField​(<a href="CtField.html" title="class in javassist">CtField</a> f,
- java.lang.String init)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Adds a field with an initial value.
-
- <p>The <code>CtField</code> belonging to another
- <code>CtClass</code> cannot be directly added to this class.
- Only a field created for this class can be added.
-
- <p>The initial value is given as an expression written in Java.
- Any regular Java expression can be used for specifying the initial
- value. The followings are examples.
-
- <pre>
- cc.addField(f, "0") // the initial value is 0.
- cc.addField(f, "i + 1") // i + 1.
- cc.addField(f, "new Point()"); // a Point object.
- </pre>
-
- <p>Here, the type of variable <code>cc</code> is <code>CtClass</code>.
- The type of <code>f</code> is <code>CtField</code>.
-
- <p>Note: do not change the modifier of the field
- (in particular, do not add or remove <code>static</code>
- to/from the modifier)
- after it is added to the class by <code>addField()</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>init</code> - an expression for the initial value.</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="CtField.Initializer.html#byExpr(java.lang.String)"><code>CtField.Initializer.byExpr(String)</code></a>,
- <a href="CtField.html#%3Cinit%3E(javassist.CtField,javassist.CtClass)"><code>CtField(CtField,CtClass)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="addField(javassist.CtField,javassist.CtField.Initializer)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>addField</h4>
- <pre class="methodSignature">public void addField​(<a href="CtField.html" title="class in javassist">CtField</a> f,
- <a href="CtField.Initializer.html" title="class in javassist">CtField.Initializer</a> init)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Adds a field with an initial value.
-
- <p>The <code>CtField</code> belonging to another
- <code>CtClass</code> cannot be directly added to this class.
- Only a field created for this class can be added.
-
- <p>For example,
-
- <pre>
- CtClass cc = ...;
- addField(new CtField(CtClass.intType, "i", cc),
- CtField.Initializer.constant(1));
- </pre>
-
- <p>This code adds an <code>int</code> field named "i". The
- initial value of this field is 1.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>init</code> - specifies the initial value of the field.</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="CtField.html#%3Cinit%3E(javassist.CtField,javassist.CtClass)"><code>CtField(CtField,CtClass)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="removeField(javassist.CtField)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>removeField</h4>
- <pre class="methodSignature">public void removeField​(<a href="CtField.html" title="class in javassist">CtField</a> f)
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a></pre>
- <div class="block">Removes a field declared in this class.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>f</code> - removed field.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code> - if the field is not found.</dd>
- </dl>
- </li>
- </ul>
- <a id="getAttribute(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getAttribute</h4>
- <pre class="methodSignature">public byte[] getAttribute​(java.lang.String name)</pre>
- <div class="block">Obtains an attribute with the given name.
- If that attribute is not found in the class file, this
- method returns null.
-
- <p>This is a convenient method mainly for obtaining
- a user-defined attribute. For dealing with attributes, see the
- <code>javassist.bytecode</code> package. For example, the following
- expression returns all the attributes of a class file.
-
- <pre>
- getClassFile().getAttributes()
- </pre></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - attribute name</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="bytecode/AttributeInfo.html" title="class in javassist.bytecode"><code>AttributeInfo</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="setAttribute(java.lang.String,byte[])">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setAttribute</h4>
- <pre class="methodSignature">public void setAttribute​(java.lang.String name,
- byte[] data)</pre>
- <div class="block">Adds a named attribute.
- An arbitrary data (smaller than 64Kb) can be saved in the class
- file. Some attribute name are reserved by the JVM.
- The attributes with the non-reserved names are ignored when a
- class file is loaded into the JVM.
- If there is already an attribute with
- the same name, this method substitutes the new one for it.
-
- <p>This is a convenient method mainly for adding
- a user-defined attribute. For dealing with attributes, see the
- <code>javassist.bytecode</code> package. For example, the following
- expression adds an attribute <code>info</code> to a class file.
-
- <pre>
- getClassFile().addAttribute(info)
- </pre></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - attribute name</dd>
- <dd><code>data</code> - attribute value</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="bytecode/AttributeInfo.html" title="class in javassist.bytecode"><code>AttributeInfo</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="instrument(javassist.CodeConverter)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>instrument</h4>
- <pre class="methodSignature">public void instrument​(<a href="CodeConverter.html" title="class in javassist">CodeConverter</a> converter)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Applies the given converter to all methods and constructors
- declared in the class. This method calls <code>instrument()</code>
- on every <code>CtMethod</code> and <code>CtConstructor</code> object
- in the class.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>converter</code> - specifies how to modify.</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="instrument(javassist.expr.ExprEditor)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>instrument</h4>
- <pre class="methodSignature">public void instrument​(<a href="expr/ExprEditor.html" title="class in javassist.expr">ExprEditor</a> editor)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Modifies the bodies of all methods and constructors
- declared in the class. This method calls <code>instrument()</code>
- on every <code>CtMethod</code> and <code>CtConstructor</code> object
- in the class.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>editor</code> - specifies how to modify.</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="toClass()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toClass</h4>
- <pre class="methodSignature">public java.lang.Class<?> toClass()
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.
- Once this method is called, further modifications are not
- allowed any more.
- To load the class, this method uses the context class loader
- of the current thread. If the program is running on some application
- server, the context class loader might be inappropriate to load the
- class.
-
- <p><b>Warning:</b> In Java 11 or later, the call to this method will
- print a warning message:</p>
- <blockquote><pre>
- WARNING: An illegal reflective access operation has occurred
- WARNING: Illegal reflective access by javassist.util.proxy.SecurityActions$3 ...
- WARNING: Please consider reporting this to the maintainers of javassist.util.proxy.SecurityActions$3
- WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
- WARNING: All illegal access operations will be denied in a future release
- </pre></blockquote>
- <p>To avoid this message, use <a href="#toClass(java.lang.Class)"><code>toClass(Class)</code></a>
- or <a href="#toClass(java.lang.invoke.MethodHandles.Lookup)"><code>toClass(java.lang.invoke.MethodHandles.Lookup)</code></a>.
- <a href="#toClass()"><code>toClass()</code></a> will be unavailable in a future release.
- </p>
-
- <p><b>Warning:</b> A Class object returned by this method may not
- work with a security manager or a signed jar file because a
- protection domain is not specified.</p>
-
- <p>Note: this method calls <code>toClass()</code>
- in <code>ClassPool</code>.</p></div>
- <dl>
- <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="#toClass(java.lang.invoke.MethodHandles.Lookup)"><code>toClass(java.lang.invoke.MethodHandles.Lookup)</code></a>,
- <a href="#toClass(java.lang.Class)"><code>toClass(Class)</code></a>,
- <a href="ClassPool.html#toClass(javassist.CtClass)"><code>ClassPool.toClass(CtClass)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="toClass(java.lang.Class)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toClass</h4>
- <pre class="methodSignature">public java.lang.Class<?> toClass​(java.lang.Class<?> neighbor)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.
- Once this method is called, further modifications are not
- allowed any more.
-
- <p>This method is provided for convenience. You should use
- <code>toClass(Lookup)</code> for better compatibility with the
- module system.
-
- <p>Note: this method calls <code>toClass()</code>
- in <code>ClassPool</code>.
-
- <p><b>Warning:</b> A Class object returned by this method may not
- work with a security manager or a signed jar file because a
- protection domain is not specified.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>neighbor</code> - A class belonging to the same package that this
- class belongs to. It is used to load the class.</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="simpleTagLabel">Since:</span></dt>
- <dd>3.24</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="ClassPool.html#toClass(javassist.CtClass,java.lang.Class)"><code>ClassPool.toClass(CtClass,Class)</code></a>,
- <a href="#toClass(java.lang.invoke.MethodHandles.Lookup)"><code>toClass(java.lang.invoke.MethodHandles.Lookup)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="toClass(java.lang.invoke.MethodHandles.Lookup)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toClass</h4>
- <pre class="methodSignature">public java.lang.Class<?> toClass​(java.lang.invoke.MethodHandles.Lookup lookup)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.
- Once this method is called, further modifications are not
- allowed any more.
-
- <p>This method is provided for convenience. If you need more
- complex functionality, you should write your own class loader.
-
- <p>Note: this method calls <code>toClass()</code>
- in <code>ClassPool</code>.
-
- <p><b>Warning:</b> A Class object returned by this method may not
- work with a security manager or a signed jar file because a
- protection domain is not specified.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>lookup</code> - used when loading the class. It has to have
- an access right to define a new class.</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="simpleTagLabel">Since:</span></dt>
- <dd>3.24</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="ClassPool.html#toClass(javassist.CtClass,java.lang.invoke.MethodHandles.Lookup)"><code>ClassPool.toClass(CtClass,java.lang.invoke.MethodHandles.Lookup)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="toClass(java.lang.ClassLoader,java.security.ProtectionDomain)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toClass</h4>
- <pre class="methodSignature">public java.lang.Class<?> toClass​(java.lang.ClassLoader loader,
- java.security.ProtectionDomain domain)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.
- Once this method is called, further modifications are not allowed
- any more.
-
- <p>The class file represented by this <code>CtClass</code> is
- loaded by the given class loader to construct a
- <code>java.lang.Class</code> object. Since a private method
- on the class loader is invoked through the reflection API,
- the caller must have permissions to do that.
-
- <p>An easy way to obtain <code>ProtectionDomain</code> object is
- to call <code>getProtectionDomain()</code>
- in <code>java.lang.Class</code>. It returns the domain that
- the class belongs to.
-
- <p>This method is provided for convenience. If you need more
- complex functionality, you should write your own class loader.
-
- <p>Note: this method calls <code>toClass()</code>
- in <code>ClassPool</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>loader</code> - the class loader used to load this class.
- If it is null, the class loader returned by
- <a href="ClassPool.html#getClassLoader()"><code>ClassPool.getClassLoader()</code></a> is used.</dd>
- <dd><code>domain</code> - the protection domain that the class belongs to.
- If it is null, the default domain created
- by <code>java.lang.ClassLoader</code> is used.</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="simpleTagLabel">Since:</span></dt>
- <dd>3.3</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="ClassPool.html#toClass(javassist.CtClass,java.lang.ClassLoader)"><code>ClassPool.toClass(CtClass,java.lang.ClassLoader)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="toClass(java.lang.ClassLoader)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toClass</h4>
- <pre class="methodSignature">@Deprecated
- public final java.lang.Class<?> toClass​(java.lang.ClassLoader loader)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
- <div class="deprecationComment">Replaced by <a href="#toClass(java.lang.ClassLoader,java.security.ProtectionDomain)"><code>toClass(ClassLoader,ProtectionDomain)</code></a></div>
- </div>
- <div class="block">Converts this class to a <code>java.lang.Class</code> object.
-
- <p><b>Warning:</b> A Class object returned by this method may not
- work with a security manager or a signed jar file because a
- protection domain is not specified.</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="detach()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>detach</h4>
- <pre class="methodSignature">public void detach()</pre>
- <div class="block">Removes this <code>CtClass</code> object from the
- <code>ClassPool</code>.
- After this method is called, any method cannot be called on the
- removed <code>CtClass</code> object.
-
- <p>If <code>get()</code> in <code>ClassPool</code> is called
- with the name of the removed method,
- the <code>ClassPool</code> will read the class file again
- and constructs another <code>CtClass</code> object representing
- the same class.</div>
- </li>
- </ul>
- <a id="stopPruning(boolean)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>stopPruning</h4>
- <pre class="methodSignature">public boolean stopPruning​(boolean stop)</pre>
- <div class="block">Disallows (or allows) automatically pruning this <code>CtClass</code>
- object.
-
- <p>
- Javassist can automatically prune a <code>CtClass</code> object
- when <code>toBytecode()</code> (or <code>toClass()</code>,
- <code>writeFile()</code>) is called.
- Since a <code>ClassPool</code> holds all instances of <code>CtClass</code>
- even after <code>toBytecode()</code> (or <code>toClass()</code>,
- <code>writeFile()</code>) is called, pruning may significantly
- save memory consumption.
-
- <p>If <code>ClassPool.doPruning</code> is true, the automatic pruning
- is on by default. Otherwise, it is off. The default value of
- <code>ClassPool.doPruning</code> is false.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>stop</code> - disallow pruning if true. Otherwise, allow.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the previous status of pruning. true if pruning is already stopped.</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#detach()"><code>detach()</code></a>,
- <a href="#prune()"><code>prune()</code></a>,
- <a href="ClassPool.html#doPruning"><code>ClassPool.doPruning</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="prune()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>prune</h4>
- <pre class="methodSignature">public void prune()</pre>
- <div class="block">Discards unnecessary attributes, in particular,
- <code>CodeAttribute</code>s (method bodies) of the class,
- to minimize the memory footprint.
- After calling this method, the class is read only.
- It cannot be modified any more.
- Furthermore, <code>toBytecode()</code>,
- <code>writeFile()</code>, <code>toClass()</code>,
- or <code>instrument()</code> cannot be called.
- However, the method names and signatures in the class etc.
- are still accessible.
-
- <p><code>toBytecode()</code>, <code>writeFile()</code>, and
- <code>toClass()</code> internally call this method if
- automatic pruning is on.
-
- <p>According to some experiments, pruning does not really reduce
- memory consumption. Only about 20%. Since pruning takes time,
- it might not pay off. So the automatic pruning is off by default.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#stopPruning(boolean)"><code>stopPruning(boolean)</code></a>,
- <a href="#detach()"><code>detach()</code></a>,
- <a href="ClassPool.html#doPruning"><code>ClassPool.doPruning</code></a>,
- <a href="#toBytecode()"><code>toBytecode()</code></a>,
- <a href="#toClass(java.lang.Class)"><code>toClass(Class)</code></a>,
- <a href="#writeFile()"><code>writeFile()</code></a>,
- <a href="#instrument(javassist.CodeConverter)"><code>instrument(CodeConverter)</code></a>,
- <a href="#instrument(javassist.expr.ExprEditor)"><code>instrument(ExprEditor)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="rebuildClassFile()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>rebuildClassFile</h4>
- <pre class="methodSignature">public void rebuildClassFile()</pre>
- <div class="block">If this method is called, the class file will be
- rebuilt when it is finally generated by
- <code>toBytecode()</code> and <code>writeFile()</code>.
- For a performance reason, the symbol table of the
- class file may contain unused entries, for example,
- after a method or a filed is deleted.
- This method
- removes those unused entries. This removal will
- minimize the size of the class file.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.8.1</dd>
- </dl>
- </li>
- </ul>
- <a id="toBytecode()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toBytecode</h4>
- <pre class="methodSignature">public byte[] toBytecode()
- throws java.io.IOException,
- <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Converts this class to a class file.
- Once this method is called, further modifications are not
- possible any more.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the contents of the class file.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code>java.io.IOException</code></dd>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="writeFile()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeFile</h4>
- <pre class="methodSignature">public void writeFile()
- throws <a href="NotFoundException.html" title="class in javassist">NotFoundException</a>,
- java.io.IOException,
- <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Writes a class file represented by this <code>CtClass</code>
- object in the current directory.
- Once this method is called, further modifications are not
- possible any more.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="NotFoundException.html" title="class in javassist">NotFoundException</a></code></dd>
- <dd><code>java.io.IOException</code></dd>
- <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="#debugWriteFile()"><code>debugWriteFile()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="writeFile(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeFile</h4>
- <pre class="methodSignature">public void writeFile​(java.lang.String directoryName)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a>,
- java.io.IOException</pre>
- <div class="block">Writes a class file represented by this <code>CtClass</code>
- object on a local disk.
- Once this method is called, further modifications are not
- possible any more.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directoryName</code> - it must end without a directory separator.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- <dd><code>java.io.IOException</code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#debugWriteFile(java.lang.String)"><code>debugWriteFile(String)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="debugWriteFile()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>debugWriteFile</h4>
- <pre class="methodSignature">public void debugWriteFile()</pre>
- <div class="block">Writes a class file as <code>writeFile()</code> does although this
- method does not prune or freeze the class after writing the class
- file. Note that, once <code>writeFile()</code> or <code>toBytecode()</code>
- is called, it cannot be called again since the class is pruned and frozen.
- This method would be useful for debugging.</div>
- </li>
- </ul>
- <a id="debugWriteFile(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>debugWriteFile</h4>
- <pre class="methodSignature">public void debugWriteFile​(java.lang.String directoryName)</pre>
- <div class="block">Writes a class file as <code>writeFile()</code> does although this
- method does not prune or freeze the class after writing the class
- file. Note that, once <code>writeFile()</code> or <code>toBytecode()</code>
- is called, it cannot be called again since the class is pruned and frozen.
- This method would be useful for debugging.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directoryName</code> - it must end without a directory separator.</dd>
- </dl>
- </li>
- </ul>
- <a id="toBytecode(java.io.DataOutputStream)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toBytecode</h4>
- <pre class="methodSignature">public void toBytecode​(java.io.DataOutputStream out)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a>,
- java.io.IOException</pre>
- <div class="block">Converts this class to a class file.
- Once this method is called, further modifications are not
- possible any more.
-
- <p>This method dose not close the output stream in the end.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>out</code> - the output stream that a class file is written to.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- <dd><code>java.io.IOException</code></dd>
- </dl>
- </li>
- </ul>
- <a id="makeUniqueName(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>makeUniqueName</h4>
- <pre class="methodSignature">public java.lang.String makeUniqueName​(java.lang.String prefix)</pre>
- <div class="block">Makes a unique member name. This method guarantees that
- the returned name is not used as a prefix of any methods
- or fields visible in this class.
- If the returned name is XYZ, then any method or field names
- in this class do not start with XYZ.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>prefix</code> - the prefix of the member name.</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/CtClass.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 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: </li>
- <li>Nested | </li>
- <li><a href="#field.summary">Field</a> | </li>
- <li>Constr | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li><a href="#field.detail">Field</a> | </li>
- <li>Constr | </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>
|