/usr/share/doc/libcglib3-java/api/net/sf/cglib/proxy/Enhancer.html is in libcglib3-java-doc 3.1+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_45) on Sat Dec 28 11:17:01 UTC 2013 -->
<title>Enhancer (cglib (Version 3.1))</title>
<meta name="date" content="2013-12-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Enhancer (cglib (Version 3.1))";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../net/sf/cglib/proxy/Dispatcher.html" title="interface in net.sf.cglib.proxy"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../net/sf/cglib/proxy/Enhancer.EnhancerKey.html" title="interface in net.sf.cglib.proxy"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?net/sf/cglib/proxy/Enhancer.html" target="_top">Frames</a></li>
<li><a href="Enhancer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_class_summary">Nested</a> | </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 name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">net.sf.cglib.proxy</div>
<h2 title="Class Enhancer" class="title">Class Enhancer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html" title="class in net.sf.cglib.core">net.sf.cglib.core.AbstractClassGenerator</a></li>
<li>
<ul class="inheritance">
<li>net.sf.cglib.proxy.Enhancer</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../net/sf/cglib/core/ClassGenerator.html" title="interface in net.sf.cglib.core">ClassGenerator</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">Enhancer</span>
extends <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html" title="class in net.sf.cglib.core">AbstractClassGenerator</a></pre>
<div class="block">Generates dynamic subclasses to enable method interception. This
class started as a substitute for the standard Dynamic Proxy support
included with JDK 1.3, but one that allowed the proxies to extend a
concrete base class, in addition to implementing interfaces. The dynamically
generated subclasses override the non-final methods of the superclass and
have hooks which callback to user-defined interceptor
implementations.
<p>
The original and most general callback type is the <a href="../../../../net/sf/cglib/proxy/MethodInterceptor.html" title="interface in net.sf.cglib.proxy"><code>MethodInterceptor</code></a>, which
in AOP terms enables "around advice"--that is, you can invoke custom code both before
and after the invocation of the "super" method. In addition you can modify the
arguments before calling the super method, or not call it at all.
<p>
Although <code>MethodInterceptor</code> is generic enough to meet any
interception need, it is often overkill. For simplicity and performance, additional
specialized callback types, such as <a href="../../../../net/sf/cglib/proxy/LazyLoader.html" title="interface in net.sf.cglib.proxy"><code>LazyLoader</code></a> are also available.
Often a single callback will be used per enhanced class, but you can control
which callback is used on a per-method basis with a <a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy"><code>CallbackFilter</code></a>.
<p>
The most common uses of this class are embodied in the static helper methods. For
advanced needs, such as customizing the <code>ClassLoader</code> to use, you should create
a new instance of <code>Enhancer</code>. Other classes within CGLIB follow a similar pattern.
<p>
All enhanced objects implement the <a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a> interface, unless <a href="../../../../net/sf/cglib/proxy/Enhancer.html#setUseFactory(boolean)"><code>setUseFactory(boolean)</code></a> is
used to explicitly disable this feature. The <code>Factory</code> interface provides an API
to change the callbacks of an existing object, as well as a faster and easier way to create
new instances of the same type.
<p>
For an almost drop-in replacement for
<code>java.lang.reflect.Proxy</code>, see the <a href="../../../../net/sf/cglib/proxy/Proxy.html" title="class in net.sf.cglib.proxy"><code>Proxy</code></a> class.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface </code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.EnhancerKey.html" title="interface in net.sf.cglib.proxy">Enhancer.EnhancerKey</a></strong></code>
<div class="block">Internal interface, only public due to ClassLoader issues.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#Enhancer()">Enhancer</a></strong>()</code>
<div class="block">Create a new <code>Enhancer</code>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#create()">create</a></strong>()</code>
<div class="block">Generate a new class if necessary and uses the specified
callbacks (if any) to create a new object instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#create(java.lang.Class[], java.lang.Object[])">create</a></strong>(java.lang.Class[] argumentTypes,
java.lang.Object[] arguments)</code>
<div class="block">Generate a new class if necessary and uses the specified
callbacks (if any) to create a new object instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#create(java.lang.Class, net.sf.cglib.proxy.Callback)">create</a></strong>(java.lang.Class type,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a> callback)</code>
<div class="block">Helper method to create an intercepted object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#create(java.lang.Class, java.lang.Class[], net.sf.cglib.proxy.Callback)">create</a></strong>(java.lang.Class superclass,
java.lang.Class[] interfaces,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a> callback)</code>
<div class="block">Helper method to create an intercepted object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#create(java.lang.Class, java.lang.Class[], net.sf.cglib.proxy.CallbackFilter, net.sf.cglib.proxy.Callback[])">create</a></strong>(java.lang.Class superclass,
java.lang.Class[] interfaces,
<a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy">CallbackFilter</a> filter,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</code>
<div class="block">Helper method to create an intercepted object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Class</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#createClass()">createClass</a></strong>()</code>
<div class="block">Generate a new class if necessary and return it without creating a new instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#generateClass(org.objectweb.asm.ClassVisitor)">generateClass</a></strong>(org.objectweb.asm.ClassVisitor v)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#getMethods(java.lang.Class, java.lang.Class[], java.util.List)">getMethods</a></strong>(java.lang.Class superclass,
java.lang.Class[] interfaces,
java.util.List methods)</code>
<div class="block">Finds all of the methods that will be extended by an
Enhancer-generated class using the specified superclass and
interfaces.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#isEnhanced(java.lang.Class)">isEnhanced</a></strong>(java.lang.Class type)</code>
<div class="block">Determine if a class was generated using <code>Enhancer</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#registerCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])">registerCallbacks</a></strong>(java.lang.Class generatedClass,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</code>
<div class="block">Call this method to register the <a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy"><code>Callback</code></a> array to use before
creating a new instance of the generated class via reflection.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#registerStaticCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])">registerStaticCallbacks</a></strong>(java.lang.Class generatedClass,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</code>
<div class="block">Similar to <a href="../../../../net/sf/cglib/proxy/Enhancer.html#registerCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])"><code>registerCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])</code></a>, but suitable for use
when multiple threads will be creating instances of the generated class.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallback(net.sf.cglib.proxy.Callback)">setCallback</a></strong>(<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a> callback)</code>
<div class="block">Set the single <a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy"><code>Callback</code></a> to use.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbackFilter(net.sf.cglib.proxy.CallbackFilter)">setCallbackFilter</a></strong>(<a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy">CallbackFilter</a> filter)</code>
<div class="block">Set the <a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy"><code>CallbackFilter</code></a> used to map the generated class' methods
to a particular callback index.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbacks(net.sf.cglib.proxy.Callback[])">setCallbacks</a></strong>(<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</code>
<div class="block">Set the array of callbacks to use.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbackType(java.lang.Class)">setCallbackType</a></strong>(java.lang.Class callbackType)</code>
<div class="block">Set the single type of <a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy"><code>Callback</code></a> to use.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbackTypes(java.lang.Class[])">setCallbackTypes</a></strong>(java.lang.Class[] callbackTypes)</code>
<div class="block">Set the array of callback types to use.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setInterceptDuringConstruction(boolean)">setInterceptDuringConstruction</a></strong>(boolean interceptDuringConstruction)</code>
<div class="block">Set whether methods called from within the proxy's constructer
will be intercepted.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setInterfaces(java.lang.Class[])">setInterfaces</a></strong>(java.lang.Class[] interfaces)</code>
<div class="block">Set the interfaces to implement.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setSerialVersionUID(java.lang.Long)">setSerialVersionUID</a></strong>(java.lang.Long sUID)</code>
<div class="block">Insert a static serialVersionUID field into the generated class.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setSuperclass(java.lang.Class)">setSuperclass</a></strong>(java.lang.Class superclass)</code>
<div class="block">Set the class which the generated class will extend.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setUseFactory(boolean)">setUseFactory</a></strong>(boolean useFactory)</code>
<div class="block">Set whether the enhanced object instances should implement
the <a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a> interface.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_net.sf.cglib.core.AbstractClassGenerator">
<!-- -->
</a>
<h3>Methods inherited from class net.sf.cglib.core.<a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html" title="class in net.sf.cglib.core">AbstractClassGenerator</a></h3>
<code><a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#getAttemptLoad()">getAttemptLoad</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#getClassLoader()">getClassLoader</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#getCurrent()">getCurrent</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#getNamingPolicy()">getNamingPolicy</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#getStrategy()">getStrategy</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#getUseCache()">getUseCache</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#setAttemptLoad(boolean)">setAttemptLoad</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#setClassLoader(java.lang.ClassLoader)">setClassLoader</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#setNamingPolicy(net.sf.cglib.core.NamingPolicy)">setNamingPolicy</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#setStrategy(net.sf.cglib.core.GeneratorStrategy)">setStrategy</a>, <a href="../../../../net/sf/cglib/core/AbstractClassGenerator.html#setUseCache(boolean)">setUseCache</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Enhancer()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Enhancer</h4>
<pre>public Enhancer()</pre>
<div class="block">Create a new <code>Enhancer</code>. A new <code>Enhancer</code>
object should be used for each generated object, and should not
be shared across threads. To create additional instances of a
generated class, use the <code>Factory</code> interface.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setSuperclass(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSuperclass</h4>
<pre>public void setSuperclass(java.lang.Class superclass)</pre>
<div class="block">Set the class which the generated class will extend. As a convenience,
if the supplied superclass is actually an interface, <code>setInterfaces</code>
will be called with the appropriate argument instead.
A non-interface argument must not be declared as final, and must have an
accessible constructor.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>superclass</code> - class to extend or interface to implement</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setInterfaces(java.lang.Class[])"><code>setInterfaces(Class[])</code></a></dd></dl>
</li>
</ul>
<a name="setInterfaces(java.lang.Class[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInterfaces</h4>
<pre>public void setInterfaces(java.lang.Class[] interfaces)</pre>
<div class="block">Set the interfaces to implement. The <code>Factory</code> interface will
always be implemented regardless of what is specified here.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>interfaces</code> - array of interfaces to implement, or null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a></dd></dl>
</li>
</ul>
<a name="setCallbackFilter(net.sf.cglib.proxy.CallbackFilter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCallbackFilter</h4>
<pre>public void setCallbackFilter(<a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy">CallbackFilter</a> filter)</pre>
<div class="block">Set the <a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy"><code>CallbackFilter</code></a> used to map the generated class' methods
to a particular callback index.
New object instances will always use the same mapping, but may use different
actual callback objects.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>filter</code> - the callback filter to use when generating a new class</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbacks(net.sf.cglib.proxy.Callback[])"><code>setCallbacks(net.sf.cglib.proxy.Callback[])</code></a></dd></dl>
</li>
</ul>
<a name="setCallback(net.sf.cglib.proxy.Callback)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCallback</h4>
<pre>public void setCallback(<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a> callback)</pre>
<div class="block">Set the single <a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy"><code>Callback</code></a> to use.
Ignored if you use <a href="../../../../net/sf/cglib/proxy/Enhancer.html#createClass()"><code>createClass()</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>callback</code> - the callback to use for all methods</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbacks(net.sf.cglib.proxy.Callback[])"><code>setCallbacks(net.sf.cglib.proxy.Callback[])</code></a></dd></dl>
</li>
</ul>
<a name="setCallbacks(net.sf.cglib.proxy.Callback[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCallbacks</h4>
<pre>public void setCallbacks(<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</pre>
<div class="block">Set the array of callbacks to use.
Ignored if you use <a href="../../../../net/sf/cglib/proxy/Enhancer.html#createClass()"><code>createClass()</code></a>.
You must use a <a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy"><code>CallbackFilter</code></a> to specify the index into this
array for each method in the proxied class.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>callbacks</code> - the callback array</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbackFilter(net.sf.cglib.proxy.CallbackFilter)"><code>setCallbackFilter(net.sf.cglib.proxy.CallbackFilter)</code></a>,
<a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallback(net.sf.cglib.proxy.Callback)"><code>setCallback(net.sf.cglib.proxy.Callback)</code></a></dd></dl>
</li>
</ul>
<a name="setUseFactory(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setUseFactory</h4>
<pre>public void setUseFactory(boolean useFactory)</pre>
<div class="block">Set whether the enhanced object instances should implement
the <a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a> interface.
This was added for tools that need for proxies to be more
indistinguishable from their targets. Also, in some cases it may
be necessary to disable the <code>Factory</code> interface to
prevent code from changing the underlying callbacks.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>useFactory</code> - whether to implement <code>Factory</code>; default is <code>true</code></dd></dl>
</li>
</ul>
<a name="setInterceptDuringConstruction(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInterceptDuringConstruction</h4>
<pre>public void setInterceptDuringConstruction(boolean interceptDuringConstruction)</pre>
<div class="block">Set whether methods called from within the proxy's constructer
will be intercepted. The default value is true. Unintercepted methods
will call the method of the proxy's base class, if it exists.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>interceptDuringConstruction</code> - whether to intercept methods called from the constructor</dd></dl>
</li>
</ul>
<a name="setCallbackType(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCallbackType</h4>
<pre>public void setCallbackType(java.lang.Class callbackType)</pre>
<div class="block">Set the single type of <a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy"><code>Callback</code></a> to use.
This may be used instead of <a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallback(net.sf.cglib.proxy.Callback)"><code>setCallback(net.sf.cglib.proxy.Callback)</code></a> when calling
<a href="../../../../net/sf/cglib/proxy/Enhancer.html#createClass()"><code>createClass()</code></a>, since it may not be possible to have
an array of actual callback instances.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>callbackType</code> - the type of callback to use for all methods</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbackTypes(java.lang.Class[])"><code>setCallbackTypes(java.lang.Class[])</code></a></dd></dl>
</li>
</ul>
<a name="setCallbackTypes(java.lang.Class[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCallbackTypes</h4>
<pre>public void setCallbackTypes(java.lang.Class[] callbackTypes)</pre>
<div class="block">Set the array of callback types to use.
This may be used instead of <a href="../../../../net/sf/cglib/proxy/Enhancer.html#setCallbacks(net.sf.cglib.proxy.Callback[])"><code>setCallbacks(net.sf.cglib.proxy.Callback[])</code></a> when calling
<a href="../../../../net/sf/cglib/proxy/Enhancer.html#createClass()"><code>createClass()</code></a>, since it may not be possible to have
an array of actual callback instances.
You must use a <a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy"><code>CallbackFilter</code></a> to specify the index into this
array for each method in the proxied class.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>callbackTypes</code> - the array of callback types</dd></dl>
</li>
</ul>
<a name="create()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>public java.lang.Object create()</pre>
<div class="block">Generate a new class if necessary and uses the specified
callbacks (if any) to create a new object instance.
Uses the no-arg constructor of the superclass.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a new instance</dd></dl>
</li>
</ul>
<a name="create(java.lang.Class[], java.lang.Object[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>public java.lang.Object create(java.lang.Class[] argumentTypes,
java.lang.Object[] arguments)</pre>
<div class="block">Generate a new class if necessary and uses the specified
callbacks (if any) to create a new object instance.
Uses the constructor of the superclass matching the <code>argumentTypes</code>
parameter, with the given arguments.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>argumentTypes</code> - constructor signature</dd><dd><code>arguments</code> - compatible wrapped arguments to pass to constructor</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new instance</dd></dl>
</li>
</ul>
<a name="createClass()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createClass</h4>
<pre>public java.lang.Class createClass()</pre>
<div class="block">Generate a new class if necessary and return it without creating a new instance.
This ignores any callbacks that have been set.
To create a new instance you will have to use reflection, and methods
called during the constructor will not be intercepted. To avoid this problem,
use the multi-arg <code>create</code> method.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Enhancer.html#create(java.lang.Class[], java.lang.Object[])"><code>create(Class[], Object[])</code></a></dd></dl>
</li>
</ul>
<a name="setSerialVersionUID(java.lang.Long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSerialVersionUID</h4>
<pre>public void setSerialVersionUID(java.lang.Long sUID)</pre>
<div class="block">Insert a static serialVersionUID field into the generated class.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sUID</code> - the field value, or null to avoid generating field.</dd></dl>
</li>
</ul>
<a name="getMethods(java.lang.Class, java.lang.Class[], java.util.List)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMethods</h4>
<pre>public static void getMethods(java.lang.Class superclass,
java.lang.Class[] interfaces,
java.util.List methods)</pre>
<div class="block">Finds all of the methods that will be extended by an
Enhancer-generated class using the specified superclass and
interfaces. This can be useful in building a list of Callback
objects. The methods are added to the end of the given list. Due
to the subclassing nature of the classes generated by Enhancer,
the methods are guaranteed to be non-static, non-final, and
non-private. Each method signature will only occur once, even if
it occurs in multiple classes.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>superclass</code> - the class that will be extended, or null</dd><dd><code>interfaces</code> - the list of interfaces that will be implemented, or null</dd><dd><code>methods</code> - the list into which to copy the applicable methods</dd></dl>
</li>
</ul>
<a name="generateClass(org.objectweb.asm.ClassVisitor)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generateClass</h4>
<pre>public void generateClass(org.objectweb.asm.ClassVisitor v)
throws java.lang.Exception</pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="registerCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>registerCallbacks</h4>
<pre>public static void registerCallbacks(java.lang.Class generatedClass,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</pre>
<div class="block">Call this method to register the <a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy"><code>Callback</code></a> array to use before
creating a new instance of the generated class via reflection. If you are using
an instance of <code>Enhancer</code> or the <a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a> interface to create
new instances, this method is unnecessary. Its primary use is for when you want to
cache and reuse a generated class yourself, and the generated class does
<i>not</i> implement the <a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a> interface.
<p>
Note that this method only registers the callbacks on the current thread.
If you want to register callbacks for instances created by multiple threads,
use <a href="../../../../net/sf/cglib/proxy/Enhancer.html#registerStaticCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])"><code>registerStaticCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])</code></a>.
<p>
The registered callbacks are overwritten and subsequently cleared
when calling any of the <code>create</code> methods (such as
<a href="../../../../net/sf/cglib/proxy/Enhancer.html#create()"><code>create()</code></a>), or any <a href="../../../../net/sf/cglib/proxy/Factory.html" title="interface in net.sf.cglib.proxy"><code>Factory</code></a> <code>newInstance</code> method.
Otherwise they are <i>not</i> cleared, and you should be careful to set them
back to <code>null</code> after creating new instances via reflection if
memory leakage is a concern.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>generatedClass</code> - a class previously created by <a href="../../../../net/sf/cglib/proxy/Enhancer.html" title="class in net.sf.cglib.proxy"><code>Enhancer</code></a></dd><dd><code>callbacks</code> - the array of callbacks to use when instances of the generated
class are created</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../net/sf/cglib/proxy/Enhancer.html#setUseFactory(boolean)"><code>setUseFactory(boolean)</code></a></dd></dl>
</li>
</ul>
<a name="registerStaticCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>registerStaticCallbacks</h4>
<pre>public static void registerStaticCallbacks(java.lang.Class generatedClass,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</pre>
<div class="block">Similar to <a href="../../../../net/sf/cglib/proxy/Enhancer.html#registerCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])"><code>registerCallbacks(java.lang.Class, net.sf.cglib.proxy.Callback[])</code></a>, but suitable for use
when multiple threads will be creating instances of the generated class.
The thread-level callbacks will always override the static callbacks.
Static callbacks are never cleared.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>generatedClass</code> - a class previously created by <a href="../../../../net/sf/cglib/proxy/Enhancer.html" title="class in net.sf.cglib.proxy"><code>Enhancer</code></a></dd><dd><code>callbacks</code> - the array of callbacks to use when instances of the generated
class are created</dd></dl>
</li>
</ul>
<a name="isEnhanced(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEnhanced</h4>
<pre>public static boolean isEnhanced(java.lang.Class type)</pre>
<div class="block">Determine if a class was generated using <code>Enhancer</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>type</code> - any class</dd>
<dt><span class="strong">Returns:</span></dt><dd>whether the class was generated using <code>Enhancer</code></dd></dl>
</li>
</ul>
<a name="create(java.lang.Class, net.sf.cglib.proxy.Callback)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>public static java.lang.Object create(java.lang.Class type,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a> callback)</pre>
<div class="block">Helper method to create an intercepted object.
For finer control over the generated instance, use a new instance of <code>Enhancer</code>
instead of this static method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>type</code> - class to extend or interface to implement</dd><dd><code>callback</code> - the callback to use for all methods</dd></dl>
</li>
</ul>
<a name="create(java.lang.Class, java.lang.Class[], net.sf.cglib.proxy.Callback)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>public static java.lang.Object create(java.lang.Class superclass,
java.lang.Class[] interfaces,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a> callback)</pre>
<div class="block">Helper method to create an intercepted object.
For finer control over the generated instance, use a new instance of <code>Enhancer</code>
instead of this static method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>type</code> - class to extend or interface to implement</dd><dd><code>interfaces</code> - array of interfaces to implement, or null</dd><dd><code>callback</code> - the callback to use for all methods</dd></dl>
</li>
</ul>
<a name="create(java.lang.Class, java.lang.Class[], net.sf.cglib.proxy.CallbackFilter, net.sf.cglib.proxy.Callback[])">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>create</h4>
<pre>public static java.lang.Object create(java.lang.Class superclass,
java.lang.Class[] interfaces,
<a href="../../../../net/sf/cglib/proxy/CallbackFilter.html" title="interface in net.sf.cglib.proxy">CallbackFilter</a> filter,
<a href="../../../../net/sf/cglib/proxy/Callback.html" title="interface in net.sf.cglib.proxy">Callback</a>[] callbacks)</pre>
<div class="block">Helper method to create an intercepted object.
For finer control over the generated instance, use a new instance of <code>Enhancer</code>
instead of this static method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>type</code> - class to extend or interface to implement</dd><dd><code>interfaces</code> - array of interfaces to implement, or null</dd><dd><code>filter</code> - the callback filter to use when generating a new class</dd><dd><code>callbacks</code> - callback implementations to use for the enhanced object</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../net/sf/cglib/proxy/Dispatcher.html" title="interface in net.sf.cglib.proxy"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../net/sf/cglib/proxy/Enhancer.EnhancerKey.html" title="interface in net.sf.cglib.proxy"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?net/sf/cglib/proxy/Enhancer.html" target="_top">Frames</a></li>
<li><a href="Enhancer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_class_summary">Nested</a> | </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 name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright (c) 2001 - Apache Software Foundation</small></p>
</body>
</html>
|