123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724 |
- <!DOCTYPE HTML>
- <!-- NewPage -->
- <html lang="en">
- <head>
- <!-- Generated by javadoc (11) on Sat May 08 11:16:00 JST 2021 -->
- <title>CtConstructor (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="CtConstructor (Javassist API)";
- }
- }
- catch(err) {
- }
- //-->
- var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
- var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
- var altColor = "altColor";
- var rowColor = "rowColor";
- var tableTab = "tableTab";
- var activeTableTab = "activeTableTab";
- var pathtoroot = "../";
- var useModuleDirectories = true;
- loadScripts(document, 'script');</script>
- <noscript>
- <div>JavaScript is disabled on your browser.</div>
- </noscript>
- <header role="banner">
- <nav role="navigation">
- <div class="fixedNav">
- <!-- ========= START OF TOP NAVBAR ======= -->
- <div class="topNav"><a id="navbar.top">
- <!-- -->
- </a>
- <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
- <a id="navbar.top.firstrow">
- <!-- -->
- </a>
- <ul class="navList" title="Navigation">
- <li><a href="../index.html">Overview</a></li>
- <li><a href="package-summary.html">Package</a></li>
- <li class="navBarCell1Rev">Class</li>
- <li><a href="class-use/CtConstructor.html">Use</a></li>
- <li><a href="package-tree.html">Tree</a></li>
- <li><a href="../deprecated-list.html">Deprecated</a></li>
- <li><a href="../index-all.html">Index</a></li>
- </ul>
- </div>
- <div class="subNav">
- <ul class="navList" id="allclasses_navbar_top">
- <li><a href="../allclasses.html">All 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>Field | </li>
- <li><a href="#constructor.summary">Constr</a> | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li>Field | </li>
- <li><a href="#constructor.detail">Constr</a> | </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 CtConstructor" class="title">Class CtConstructor</h2>
- </div>
- <div class="contentContainer">
- <ul class="inheritance">
- <li>java.lang.Object</li>
- <li>
- <ul class="inheritance">
- <li><a href="CtMember.html" title="class in javassist">javassist.CtMember</a></li>
- <li>
- <ul class="inheritance">
- <li><a href="CtBehavior.html" title="class in javassist">javassist.CtBehavior</a></li>
- <li>
- <ul class="inheritance">
- <li>javassist.CtConstructor</li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- <div class="description">
- <ul class="blockList">
- <li class="blockList">
- <hr>
- <pre>public final class <span class="typeNameLabel">CtConstructor</span>
- extends <a href="CtBehavior.html" title="class in javassist">CtBehavior</a></pre>
- <div class="block">An instance of CtConstructor represents a constructor.
- It may represent a static constructor
- (class initializer). To distinguish a constructor and a class
- initializer, call <code>isClassInitializer()</code>.
-
- <p>See the super class <code>CtBehavior</code> as well since
- a number of useful methods are in <code>CtBehavior</code>.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtClass.html#getDeclaredConstructors()"><code>CtClass.getDeclaredConstructors()</code></a>,
- <a href="CtClass.html#getClassInitializer()"><code>CtClass.getClassInitializer()</code></a>,
- <a href="CtNewConstructor.html" title="class in javassist"><code>CtNewConstructor</code></a></dd>
- </dl>
- </li>
- </ul>
- </div>
- <div class="summary">
- <ul class="blockList">
- <li class="blockList">
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <section role="region">
- <ul class="blockList">
- <li class="blockList"><a id="constructor.summary">
- <!-- -->
- </a>
- <h3>Constructor Summary</h3>
- <table class="memberSummary">
- <caption><span>Constructors</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colFirst" scope="col">Constructor</th>
- <th class="colLast" scope="col">Description</th>
- </tr>
- <tr class="altColor">
- <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(javassist.CtClass%5B%5D,javassist.CtClass)">CtConstructor</a></span>​(<a href="CtClass.html" title="class in javassist">CtClass</a>[] parameters,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring)</code></th>
- <td class="colLast">
- <div class="block">Creates a constructor with no constructor body.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(javassist.CtConstructor,javassist.CtClass,javassist.ClassMap)">CtConstructor</a></span>​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> src,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring,
- <a href="ClassMap.html" title="class in javassist">ClassMap</a> map)</code></th>
- <td class="colLast">
- <div class="block">Creates a copy of a <code>CtConstructor</code> object.</div>
- </td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- <!-- ========== METHOD SUMMARY =========== -->
- <section role="region">
- <ul class="blockList">
- <li class="blockList"><a id="method.summary">
- <!-- -->
- </a>
- <h3>Method Summary</h3>
- <table class="memberSummary">
- <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </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></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colSecond" scope="col">Method</th>
- <th class="colLast" scope="col">Description</th>
- </tr>
- <tr id="i0" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#callsSuper()">callsSuper</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns true if this constructor calls a constructor
- of the super class.</div>
- </td>
- </tr>
- <tr id="i1" class="rowColor">
- <td class="colFirst"><code>java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLongName()">getLongName</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns the constructor name followed by parameter types
- such as <code>javassist.CtConstructor(CtClass[],CtClass)</code>.</div>
- </td>
- </tr>
- <tr id="i2" class="altColor">
- <td class="colFirst"><code>java.lang.String</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getName()">getName</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Obtains the name of this constructor.</div>
- </td>
- </tr>
- <tr id="i3" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#insertBeforeBody(java.lang.String)">insertBeforeBody</a></span>​(java.lang.String src)</code></th>
- <td class="colLast">
- <div class="block">Inserts bytecode just after another constructor in the super class
- or this class is called.</div>
- </td>
- </tr>
- <tr id="i4" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isClassInitializer()">isClassInitializer</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns true if this object represents a static initializer.</div>
- </td>
- </tr>
- <tr id="i5" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isConstructor()">isConstructor</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns true if this object represents a constructor.</div>
- </td>
- </tr>
- <tr id="i6" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEmpty()">isEmpty</a></span>()</code></th>
- <td class="colLast">
- <div class="block">Returns true if the constructor (or static initializer)
- is the default one.</div>
- </td>
- </tr>
- <tr id="i7" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBody(java.lang.String)">setBody</a></span>​(java.lang.String src)</code></th>
- <td class="colLast">
- <div class="block">Sets a constructor body.</div>
- </td>
- </tr>
- <tr id="i8" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBody(javassist.CtConstructor,javassist.ClassMap)">setBody</a></span>​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> src,
- <a href="ClassMap.html" title="class in javassist">ClassMap</a> map)</code></th>
- <td class="colLast">
- <div class="block">Copies a constructor body from another constructor.</div>
- </td>
- </tr>
- <tr id="i9" class="rowColor">
- <td class="colFirst"><code><a href="CtMethod.html" title="class in javassist">CtMethod</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toMethod(java.lang.String,javassist.CtClass)">toMethod</a></span>​(java.lang.String name,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring)</code></th>
- <td class="colLast">
- <div class="block">Makes a copy of this constructor and converts it into a method.</div>
- </td>
- </tr>
- <tr id="i10" class="altColor">
- <td class="colFirst"><code><a href="CtMethod.html" title="class in javassist">CtMethod</a></code></td>
- <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toMethod(java.lang.String,javassist.CtClass,javassist.ClassMap)">toMethod</a></span>​(java.lang.String name,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring,
- <a href="ClassMap.html" title="class in javassist">ClassMap</a> map)</code></th>
- <td class="colLast">
- <div class="block">Makes a copy of this constructor and converts it into a method.</div>
- </td>
- </tr>
- </table>
- <ul class="blockList">
- <li class="blockList"><a id="methods.inherited.from.class.javassist.CtBehavior">
- <!-- -->
- </a>
- <h3>Methods inherited from class javassist.<a href="CtBehavior.html" title="class in javassist">CtBehavior</a></h3>
- <code><a href="CtBehavior.html#addCatch(java.lang.String,javassist.CtClass)">addCatch</a>, <a href="CtBehavior.html#addCatch(java.lang.String,javassist.CtClass,java.lang.String)">addCatch</a>, <a href="CtBehavior.html#addLocalVariable(java.lang.String,javassist.CtClass)">addLocalVariable</a>, <a href="CtBehavior.html#addParameter(javassist.CtClass)">addParameter</a>, <a href="CtBehavior.html#getAnnotation(java.lang.Class)">getAnnotation</a>, <a href="CtBehavior.html#getAnnotations()">getAnnotations</a>, <a href="CtBehavior.html#getAttribute(java.lang.String)">getAttribute</a>, <a href="CtBehavior.html#getAvailableAnnotations()">getAvailableAnnotations</a>, <a href="CtBehavior.html#getAvailableParameterAnnotations()">getAvailableParameterAnnotations</a>, <a href="CtBehavior.html#getExceptionTypes()">getExceptionTypes</a>, <a href="CtBehavior.html#getGenericSignature()">getGenericSignature</a>, <a href="CtBehavior.html#getMethodInfo()">getMethodInfo</a>, <a href="CtBehavior.html#getMethodInfo2()">getMethodInfo2</a>, <a href="CtBehavior.html#getModifiers()">getModifiers</a>, <a href="CtBehavior.html#getParameterAnnotations()">getParameterAnnotations</a>, <a href="CtBehavior.html#getParameterTypes()">getParameterTypes</a>, <a href="CtBehavior.html#getSignature()">getSignature</a>, <a href="CtBehavior.html#hasAnnotation(java.lang.String)">hasAnnotation</a>, <a href="CtBehavior.html#insertAfter(java.lang.String)">insertAfter</a>, <a href="CtBehavior.html#insertAfter(java.lang.String,boolean)">insertAfter</a>, <a href="CtBehavior.html#insertAfter(java.lang.String,boolean,boolean)">insertAfter</a>, <a href="CtBehavior.html#insertAt(int,boolean,java.lang.String)">insertAt</a>, <a href="CtBehavior.html#insertAt(int,java.lang.String)">insertAt</a>, <a href="CtBehavior.html#insertBefore(java.lang.String)">insertBefore</a>, <a href="CtBehavior.html#insertParameter(javassist.CtClass)">insertParameter</a>, <a href="CtBehavior.html#instrument(javassist.CodeConverter)">instrument</a>, <a href="CtBehavior.html#instrument(javassist.expr.ExprEditor)">instrument</a>, <a href="CtBehavior.html#setAttribute(java.lang.String,byte%5B%5D)">setAttribute</a>, <a href="CtBehavior.html#setBody(java.lang.String,java.lang.String,java.lang.String)">setBody</a>, <a href="CtBehavior.html#setExceptionTypes(javassist.CtClass%5B%5D)">setExceptionTypes</a>, <a href="CtBehavior.html#setGenericSignature(java.lang.String)">setGenericSignature</a>, <a href="CtBehavior.html#setModifiers(int)">setModifiers</a>, <a href="CtBehavior.html#useCflow(java.lang.String)">useCflow</a></code></li>
- </ul>
- <ul class="blockList">
- <li class="blockList"><a id="methods.inherited.from.class.javassist.CtMember">
- <!-- -->
- </a>
- <h3>Methods inherited from class javassist.<a href="CtMember.html" title="class in javassist">CtMember</a></h3>
- <code><a href="CtMember.html#getDeclaringClass()">getDeclaringClass</a>, <a href="CtMember.html#hasAnnotation(java.lang.Class)">hasAnnotation</a>, <a href="CtMember.html#toString()">toString</a>, <a href="CtMember.html#visibleFrom(javassist.CtClass)">visibleFrom</a></code></li>
- </ul>
- <ul class="blockList">
- <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
- <!-- -->
- </a>
- <h3>Methods inherited from class java.lang.Object</h3>
- <code>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
- </ul>
- </li>
- </ul>
- </section>
- </li>
- </ul>
- </div>
- <div class="details">
- <ul class="blockList">
- <li class="blockList">
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <section role="region">
- <ul class="blockList">
- <li class="blockList"><a id="constructor.detail">
- <!-- -->
- </a>
- <h3>Constructor Detail</h3>
- <a id="<init>(javassist.CtClass[],javassist.CtClass)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>CtConstructor</h4>
- <pre>public CtConstructor​(<a href="CtClass.html" title="class in javassist">CtClass</a>[] parameters,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring)</pre>
- <div class="block">Creates a constructor with no constructor body.
- The created constructor
- must be added to a class with <code>CtClass.addConstructor()</code>.
-
- <p>The created constructor does not include a constructor body,
- which must be specified with <code>setBody()</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>declaring</code> - the class to which the created method is added.</dd>
- <dd><code>parameters</code> - a list of the parameter types</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtClass.html#addConstructor(javassist.CtConstructor)"><code>CtClass.addConstructor(CtConstructor)</code></a>,
- <a href="#setBody(java.lang.String)"><code>setBody(String)</code></a>,
- <a href="#setBody(javassist.CtConstructor,javassist.ClassMap)"><code>setBody(CtConstructor,ClassMap)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="<init>(javassist.CtConstructor,javassist.CtClass,javassist.ClassMap)">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>CtConstructor</h4>
- <pre>public CtConstructor​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> src,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring,
- <a href="ClassMap.html" title="class in javassist">ClassMap</a> map)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Creates a copy of a <code>CtConstructor</code> object.
- The created constructor must be
- added to a class with <code>CtClass.addConstructor()</code>.
-
- <p>All occurrences of class names in the created constructor
- are replaced with names specified by
- <code>map</code> if <code>map</code> is not <code>null</code>.
-
- <p>By default, all the occurrences of the names of the class
- declaring <code>src</code> and the superclass are replaced
- with the name of the class and the superclass that
- the created constructor is added to.
- This is done whichever <code>map</code> is null or not.
- To prevent this replacement, call <code>ClassMap.fix()</code>
- or <code>put()</code> to explicitly specify replacement.
-
- <p><b>Note:</b> if the <code>.class</code> notation (for example,
- <code>String.class</code>) is included in an expression, the
- Javac compiler may produce a helper method.
- Since this constructor never
- copies this helper method, the programmers have the responsiblity of
- copying it. Otherwise, use <code>Class.forName()</code> in the
- expression.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>src</code> - the source method.</dd>
- <dd><code>declaring</code> - the class to which the created method is added.</dd>
- <dd><code>map</code> - the hashtable associating original class names
- with substituted names.
- It can be <code>null</code>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="CtClass.html#addConstructor(javassist.CtConstructor)"><code>CtClass.addConstructor(CtConstructor)</code></a>,
- <a href="ClassMap.html#fix(java.lang.String)"><code>ClassMap.fix(String)</code></a></dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </section>
- <!-- ============ METHOD DETAIL ========== -->
- <section role="region">
- <ul class="blockList">
- <li class="blockList"><a id="method.detail">
- <!-- -->
- </a>
- <h3>Method Detail</h3>
- <a id="isConstructor()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isConstructor</h4>
- <pre class="methodSignature">public boolean isConstructor()</pre>
- <div class="block">Returns true if this object represents a constructor.</div>
- </li>
- </ul>
- <a id="isClassInitializer()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isClassInitializer</h4>
- <pre class="methodSignature">public boolean isClassInitializer()</pre>
- <div class="block">Returns true if this object represents a static initializer.</div>
- </li>
- </ul>
- <a id="getLongName()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getLongName</h4>
- <pre class="methodSignature">public java.lang.String getLongName()</pre>
- <div class="block">Returns the constructor name followed by parameter types
- such as <code>javassist.CtConstructor(CtClass[],CtClass)</code>.</div>
- <dl>
- <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
- <dd><code><a href="CtBehavior.html#getLongName()">getLongName</a></code> in class <code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a></code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>3.5</dd>
- </dl>
- </li>
- </ul>
- <a id="getName()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getName</h4>
- <pre class="methodSignature">public java.lang.String getName()</pre>
- <div class="block">Obtains the name of this constructor.
- It is the same as the simple name of the class declaring this
- constructor. If this object represents a class initializer,
- then this method returns <code>"<clinit>"</code>.</div>
- <dl>
- <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
- <dd><code><a href="CtMember.html#getName()">getName</a></code> in class <code><a href="CtMember.html" title="class in javassist">CtMember</a></code></dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="#getName()"><code>getName()</code></a></dd>
- </dl>
- </li>
- </ul>
- <a id="isEmpty()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isEmpty</h4>
- <pre class="methodSignature">public boolean isEmpty()</pre>
- <div class="block">Returns true if the constructor (or static initializer)
- is the default one. This method returns true if the constructor
- takes some arguments but it does not perform anything except
- calling <code>super()</code> (the no-argument constructor of
- the super class).</div>
- <dl>
- <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
- <dd><code><a href="CtBehavior.html#isEmpty()">isEmpty</a></code> in class <code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="callsSuper()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>callsSuper</h4>
- <pre class="methodSignature">public boolean callsSuper()
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Returns true if this constructor calls a constructor
- of the super class. This method returns false if it
- calls another constructor of this class by <code>this()</code>.</div>
- <dl>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="setBody(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setBody</h4>
- <pre class="methodSignature">public void setBody​(java.lang.String src)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Sets a constructor body.</div>
- <dl>
- <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
- <dd><code><a href="CtBehavior.html#setBody(java.lang.String)">setBody</a></code> in class <code><a href="CtBehavior.html" title="class in javassist">CtBehavior</a></code></dd>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>src</code> - the source code representing the constructor body.
- It must be a single statement or block.
- If it is <code>null</code>, the substituted
- constructor body does nothing except calling
- <code>super()</code>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="setBody(javassist.CtConstructor,javassist.ClassMap)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>setBody</h4>
- <pre class="methodSignature">public void setBody​(<a href="CtConstructor.html" title="class in javassist">CtConstructor</a> src,
- <a href="ClassMap.html" title="class in javassist">ClassMap</a> map)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Copies a constructor body from another constructor.
-
- <p>All occurrences of the class names in the copied body
- are replaced with the names specified by
- <code>map</code> if <code>map</code> is not <code>null</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>src</code> - the method that the body is copied from.</dd>
- <dd><code>map</code> - the hashtable associating original class names
- with substituted names.
- It can be <code>null</code>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="insertBeforeBody(java.lang.String)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>insertBeforeBody</h4>
- <pre class="methodSignature">public void insertBeforeBody​(java.lang.String src)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Inserts bytecode just after another constructor in the super class
- or this class is called.
- It does not work if this object represents a class initializer.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>src</code> - the source code representing the inserted bytecode.
- It must be a single statement or block.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="toMethod(java.lang.String,javassist.CtClass)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toMethod</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a> toMethod​(java.lang.String name,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Makes a copy of this constructor and converts it into a method.
- The signature of the mehtod is the same as the that of this constructor.
- The return type is <code>void</code>. The resulting method must be
- appended to the class specified by <code>declaring</code>.
- If this constructor is a static initializer, the resulting method takes
- no parameter.
-
- <p>An occurrence of another constructor call <code>this()</code>
- or a super constructor call <code>super()</code> is
- eliminated from the resulting method.
-
- <p>The immediate super class of the class declaring this constructor
- must be also a super class of the class declaring the resulting method.
- If the constructor accesses a field, the class declaring the resulting method
- must also declare a field with the same name and type.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - the name of the resulting method.</dd>
- <dd><code>declaring</code> - the class declaring the resulting method.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- </dl>
- </li>
- </ul>
- <a id="toMethod(java.lang.String,javassist.CtClass,javassist.ClassMap)">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>toMethod</h4>
- <pre class="methodSignature">public <a href="CtMethod.html" title="class in javassist">CtMethod</a> toMethod​(java.lang.String name,
- <a href="CtClass.html" title="class in javassist">CtClass</a> declaring,
- <a href="ClassMap.html" title="class in javassist">ClassMap</a> map)
- throws <a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></pre>
- <div class="block">Makes a copy of this constructor and converts it into a method.
- The signature of the method is the same as the that of this constructor.
- The return type is <code>void</code>. The resulting method must be
- appended to the class specified by <code>declaring</code>.
- If this constructor is a static initializer, the resulting method takes
- no parameter.
-
- <p>An occurrence of another constructor call <code>this()</code>
- or a super constructor call <code>super()</code> is
- eliminated from the resulting method.
-
- <p>The immediate super class of the class declaring this constructor
- must be also a super class of the class declaring the resulting method
- (this is obviously true if the second parameter <code>declaring</code> is
- the same as the class declaring this constructor).
- If the constructor accesses a field, the class declaring the resulting method
- must also declare a field with the same name and type.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - the name of the resulting method.</dd>
- <dd><code>declaring</code> - the class declaring the resulting method.
- It is normally the same as the class declaring this
- constructor.</dd>
- <dd><code>map</code> - the hash table associating original class names
- with substituted names. The original class names will be
- replaced while making a copy.
- <code>map</code> can be <code>null</code>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="CannotCompileException.html" title="class in javassist">CannotCompileException</a></code></dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </section>
- </li>
- </ul>
- </div>
- </div>
- </main>
- <!-- ========= END OF CLASS DATA ========= -->
- <footer role="contentinfo">
- <nav role="navigation">
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <div class="bottomNav"><a id="navbar.bottom">
- <!-- -->
- </a>
- <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
- <a id="navbar.bottom.firstrow">
- <!-- -->
- </a>
- <ul class="navList" title="Navigation">
- <li><a href="../index.html">Overview</a></li>
- <li><a href="package-summary.html">Package</a></li>
- <li class="navBarCell1Rev">Class</li>
- <li><a href="class-use/CtConstructor.html">Use</a></li>
- <li><a href="package-tree.html">Tree</a></li>
- <li><a href="../deprecated-list.html">Deprecated</a></li>
- <li><a href="../index-all.html">Index</a></li>
- </ul>
- </div>
- <div class="subNav">
- <ul class="navList" id="allclasses_navbar_bottom">
- <li><a href="../allclasses.html">All 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>Field | </li>
- <li><a href="#constructor.summary">Constr</a> | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li>Field | </li>
- <li><a href="#constructor.detail">Constr</a> | </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>
|