1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<!--NewPage--> 3<HTML> 4<HEAD> 5<!-- Generated by javadoc (build 1.6.0_26) on Tue Jan 10 12:29:36 EST 2012 --> 6<TITLE> 7ProxyBuilder (dexmaker) 8</TITLE> 9 10<META NAME="date" CONTENT="2012-01-10"> 11 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> 13 14<SCRIPT type="text/javascript"> 15function windowTitle() 16{ 17 if (location.href.indexOf('is-external=true') == -1) { 18 parent.document.title="ProxyBuilder (dexmaker)"; 19 } 20} 21</SCRIPT> 22<NOSCRIPT> 23</NOSCRIPT> 24 25</HEAD> 26 27<BODY BGCOLOR="white" onload="windowTitle();"> 28<HR> 29 30 31<!-- ========= START OF TOP NAVBAR ======= --> 32<A NAME="navbar_top"><!-- --></A> 33<A HREF="#skip-navbar_top" title="Skip navigation links"></A> 34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 35<TR> 36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 37<A NAME="navbar_top_firstrow"><!-- --></A> 38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 39 <TR ALIGN="center" VALIGN="top"> 40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 47 </TR> 48</TABLE> 49</TD> 50<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 51</EM> 52</TD> 53</TR> 54 55<TR> 56<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 57 PREV CLASS 58 NEXT CLASS</FONT></TD> 59<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 60 <A HREF="../../../../index.html?com/google/dexmaker/stock/ProxyBuilder.html" target="_top"><B>FRAMES</B></A> 61 <A HREF="ProxyBuilder.html" target="_top"><B>NO FRAMES</B></A> 62 <SCRIPT type="text/javascript"> 63 <!-- 64 if(window==top) { 65 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 66 } 67 //--> 68</SCRIPT> 69<NOSCRIPT> 70 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 71</NOSCRIPT> 72 73 74</FONT></TD> 75</TR> 76<TR> 77<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 78 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 79<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 80DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> 81</TR> 82</TABLE> 83<A NAME="skip-navbar_top"></A> 84<!-- ========= END OF TOP NAVBAR ========= --> 85 86<HR> 87<!-- ======== START OF CLASS DATA ======== --> 88<H2> 89<FONT SIZE="-1"> 90com.google.dexmaker.stock</FONT> 91<BR> 92Class ProxyBuilder<T></H2> 93<PRE> 94<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> 95 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.dexmaker.stock.ProxyBuilder<T></B> 96</PRE> 97<HR> 98<DL> 99<DT><PRE>public final class <B>ProxyBuilder<T></B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> 100</PRE> 101 102<P> 103Creates dynamic proxies of concrete classes. 104 <p> 105 This is similar to the <code>java.lang.reflect.Proxy</code> class, but works for classes instead of 106 interfaces. 107 <h3>Example</h3> 108 The following example demonstrates the creation of a dynamic proxy for <code>java.util.Random</code> 109 which will always return 4 when asked for integers, and which logs method calls to every method. 110 <pre> 111 InvocationHandler handler = new InvocationHandler() { 112 @Override 113 public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { 114 if (method.getName().equals("nextInt")) { 115 // Chosen by fair dice roll, guaranteed to be random. 116 return 4; 117 } 118 Object result = ProxyBuilder.callSuper(proxy, method, args); 119 System.out.println("Method: " + method.getName() + " args: " 120 + Arrays.toString(args) + " result: " + result); 121 return result; 122 } 123 }; 124 Random debugRandom = ProxyBuilder.forClass(Random.class) 125 .dexCache(getInstrumentation().getTargetContext().getDir("dx", Context.MODE_PRIVATE)) 126 .handler(handler) 127 .build(); 128 assertEquals(4, debugRandom.nextInt()); 129 debugRandom.setSeed(0); 130 assertTrue(debugRandom.nextBoolean()); 131 </pre> 132 <h3>Usage</h3> 133 Call <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#forClass(java.lang.Class)"><CODE>forClass(Class)</CODE></A> for the Class you wish to proxy. Call 134 <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#handler(java.lang.reflect.InvocationHandler)"><CODE>handler(InvocationHandler)</CODE></A> passing in an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect"><CODE>InvocationHandler</CODE></A>, and then call 135 <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#build()"><CODE>build()</CODE></A>. The returned instance will be a dynamically generated subclass where all method 136 calls will be delegated to the invocation handler, except as noted below. 137 <p> 138 The static method <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#callSuper(java.lang.Object, java.lang.reflect.Method, java.lang.Object...)"><CODE>callSuper(Object, Method, Object...)</CODE></A> allows you to access the original 139 super method for a given proxy. This allows the invocation handler to selectively override some 140 methods but not others. 141 <p> 142 By default, the <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#build()"><CODE>build()</CODE></A> method will call the no-arg constructor belonging to the class 143 being proxied. If you wish to call a different constructor, you must provide arguments for both 144 <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#constructorArgTypes(java.lang.Class...)"><CODE>constructorArgTypes(Class[])</CODE></A> and <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#constructorArgValues(java.lang.Object...)"><CODE>constructorArgValues(Object[])</CODE></A>. 145 <p> 146 This process works only for classes with public and protected level of visibility. 147 <p> 148 You may proxy abstract classes. You may not proxy final classes. 149 <p> 150 Only non-private, non-final, non-static methods will be dispatched to the invocation handler. 151 Private, static or final methods will always call through to the superclass as normal. 152 <p> 153 The <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang"><CODE>Object.finalize()</CODE></A> method on <code>Object</code> will not be proxied. 154 <p> 155 You must provide a dex cache directory via the <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#dexCache(java.io.File)"><CODE>dexCache(File)</CODE></A> method. You should take 156 care not to make this a world-writable directory, so that third parties cannot inject code into 157 your application. A suitable parameter for these output directories would be something like 158 this: 159 <pre><code>getApplicationContext().getDir("dx", Context.MODE_PRIVATE); 160 </code></pre> 161 <p> 162 If the base class to be proxied leaks the <code>this</code> pointer in the constructor (bad practice), 163 that is to say calls a non-private non-final method from the constructor, the invocation handler 164 will not be invoked. As a simple concrete example, when proxying Random we discover that it 165 inernally calls setSeed during the constructor. The proxy will not intercept this call during 166 proxy construction, but will intercept as normal afterwards. This behaviour may be subject to 167 change in future releases. 168 <p> 169 This class is <b>not thread safe</b>. 170<P> 171 172<P> 173<HR> 174 175<P> 176 177<!-- ========== METHOD SUMMARY =========== --> 178 179<A NAME="method_summary"><!-- --></A> 180<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 181<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 182<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 183<B>Method Summary</B></FONT></TH> 184</TR> 185<TR BGCOLOR="white" CLASS="TableRowColor"> 186<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 187<CODE> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A></CODE></FONT></TD> 188<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#build()">build</A></B>()</CODE> 189 190<BR> 191 Create a new instance of the class to proxy.</TD> 192</TR> 193<TR BGCOLOR="white" CLASS="TableRowColor"> 194<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 195<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> 196<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#callSuper(java.lang.Object, java.lang.reflect.Method, java.lang.Object...)">callSuper</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> proxy, 197 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</A> method, 198 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>... args)</CODE> 199 200<BR> 201 </TD> 202</TR> 203<TR BGCOLOR="white" CLASS="TableRowColor"> 204<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 205<CODE> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>></CODE></FONT></TD> 206<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#constructorArgTypes(java.lang.Class...)">constructorArgTypes</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?>... constructorArgTypes)</CODE> 207 208<BR> 209 </TD> 210</TR> 211<TR BGCOLOR="white" CLASS="TableRowColor"> 212<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 213<CODE> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>></CODE></FONT></TD> 214<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#constructorArgValues(java.lang.Object...)">constructorArgValues</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>... constructorArgValues)</CODE> 215 216<BR> 217 </TD> 218</TR> 219<TR BGCOLOR="white" CLASS="TableRowColor"> 220<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 221<CODE> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>></CODE></FONT></TD> 222<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#dexCache(java.io.File)">dexCache</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> dexCache)</CODE> 223 224<BR> 225 </TD> 226</TR> 227<TR BGCOLOR="white" CLASS="TableRowColor"> 228<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 229<CODE>static 230<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 231<TR ALIGN="right" VALIGN=""> 232<TD NOWRAP><FONT SIZE="-1"> 233<CODE><T> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><T></CODE></FONT></TD> 234</TR> 235</TABLE> 236</CODE></FONT></TD> 237<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#forClass(java.lang.Class)">forClass</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> clazz)</CODE> 238 239<BR> 240 </TD> 241</TR> 242<TR BGCOLOR="white" CLASS="TableRowColor"> 243<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 244<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect">InvocationHandler</A></CODE></FONT></TD> 245<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#getInvocationHandler(java.lang.Object)">getInvocationHandler</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> instance)</CODE> 246 247<BR> 248 Returns the proxy's <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect"><CODE>InvocationHandler</CODE></A>.</TD> 249</TR> 250<TR BGCOLOR="white" CLASS="TableRowColor"> 251<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 252<CODE> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>></CODE></FONT></TD> 253<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#handler(java.lang.reflect.InvocationHandler)">handler</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect">InvocationHandler</A> handler)</CODE> 254 255<BR> 256 </TD> 257</TR> 258<TR BGCOLOR="white" CLASS="TableRowColor"> 259<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 260<CODE> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>></CODE></FONT></TD> 261<TD><CODE><B><A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html#parentClassLoader(java.lang.ClassLoader)">parentClassLoader</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</A> parent)</CODE> 262 263<BR> 264 Specifies the parent ClassLoader to use when creating the proxy.</TD> 265</TR> 266</TABLE> 267 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 268<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 269<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 270<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> 271</TR> 272<TR BGCOLOR="white" CLASS="TableRowColor"> 273<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> 274</TR> 275</TABLE> 276 277<P> 278 279<!-- ============ METHOD DETAIL ========== --> 280 281<A NAME="method_detail"><!-- --></A> 282<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 283<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 284<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 285<B>Method Detail</B></FONT></TH> 286</TR> 287</TABLE> 288 289<A NAME="forClass(java.lang.Class)"><!-- --></A><H3> 290forClass</H3> 291<PRE> 292public static <T> <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><T> <B>forClass</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> clazz)</PRE> 293<DL> 294<DD><DL> 295</DL> 296</DD> 297</DL> 298<HR> 299 300<A NAME="parentClassLoader(java.lang.ClassLoader)"><!-- --></A><H3> 301parentClassLoader</H3> 302<PRE> 303public <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>> <B>parentClassLoader</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</A> parent)</PRE> 304<DL> 305<DD>Specifies the parent ClassLoader to use when creating the proxy. 306 307 <p>If null, <code>ProxyBuilder.class.getClassLoader()</code> will be used. 308<P> 309<DD><DL> 310</DL> 311</DD> 312</DL> 313<HR> 314 315<A NAME="handler(java.lang.reflect.InvocationHandler)"><!-- --></A><H3> 316handler</H3> 317<PRE> 318public <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>> <B>handler</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect">InvocationHandler</A> handler)</PRE> 319<DL> 320<DD><DL> 321</DL> 322</DD> 323</DL> 324<HR> 325 326<A NAME="dexCache(java.io.File)"><!-- --></A><H3> 327dexCache</H3> 328<PRE> 329public <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>> <B>dexCache</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> dexCache)</PRE> 330<DL> 331<DD><DL> 332</DL> 333</DD> 334</DL> 335<HR> 336 337<A NAME="constructorArgValues(java.lang.Object...)"><!-- --></A><H3> 338constructorArgValues</H3> 339<PRE> 340public <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>> <B>constructorArgValues</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>... constructorArgValues)</PRE> 341<DL> 342<DD><DL> 343</DL> 344</DD> 345</DL> 346<HR> 347 348<A NAME="constructorArgTypes(java.lang.Class...)"><!-- --></A><H3> 349constructorArgTypes</H3> 350<PRE> 351public <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="class in com.google.dexmaker.stock">ProxyBuilder</A><<A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A>> <B>constructorArgTypes</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?>... constructorArgTypes)</PRE> 352<DL> 353<DD><DL> 354</DL> 355</DD> 356</DL> 357<HR> 358 359<A NAME="build()"><!-- --></A><H3> 360build</H3> 361<PRE> 362public <A HREF="../../../../com/google/dexmaker/stock/ProxyBuilder.html" title="type parameter in ProxyBuilder">T</A> <B>build</B>() 363 throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> 364<DL> 365<DD>Create a new instance of the class to proxy. 366<P> 367<DD><DL> 368 369<DT><B>Throws:</B> 370<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the class we are trying to create a proxy for is 371 not accessible. 372<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if an exception occurred writing to the <code>dexCache</code> directory. 373<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/UndeclaredThrowableException.html?is-external=true" title="class or interface in java.lang.reflect">UndeclaredThrowableException</A></CODE> - if the constructor for the base class to proxy throws 374 a declared exception during construction. 375<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the handler is null, if the constructor argument types 376 do not match the constructor argument values, or if no such constructor exists.</DL> 377</DD> 378</DL> 379<HR> 380 381<A NAME="getInvocationHandler(java.lang.Object)"><!-- --></A><H3> 382getInvocationHandler</H3> 383<PRE> 384public static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect">InvocationHandler</A> <B>getInvocationHandler</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> instance)</PRE> 385<DL> 386<DD>Returns the proxy's <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect"><CODE>InvocationHandler</CODE></A>. 387<P> 388<DD><DL> 389 390<DT><B>Throws:</B> 391<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the object supplied is not a proxy created by this class.</DL> 392</DD> 393</DL> 394<HR> 395 396<A NAME="callSuper(java.lang.Object, java.lang.reflect.Method, java.lang.Object...)"><!-- --></A><H3> 397callSuper</H3> 398<PRE> 399public static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>callSuper</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> proxy, 400 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</A> method, 401 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>... args) 402 throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/SecurityException.html?is-external=true" title="class or interface in java.lang">SecurityException</A>, 403 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalAccessException.html?is-external=true" title="class or interface in java.lang">IllegalAccessException</A>, 404 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationTargetException.html?is-external=true" title="class or interface in java.lang.reflect">InvocationTargetException</A>, 405 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/NoSuchMethodException.html?is-external=true" title="class or interface in java.lang">NoSuchMethodException</A></PRE> 406<DL> 407<DD><DL> 408 409<DT><B>Throws:</B> 410<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/SecurityException.html?is-external=true" title="class or interface in java.lang">SecurityException</A></CODE> 411<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalAccessException.html?is-external=true" title="class or interface in java.lang">IllegalAccessException</A></CODE> 412<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationTargetException.html?is-external=true" title="class or interface in java.lang.reflect">InvocationTargetException</A></CODE> 413<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/NoSuchMethodException.html?is-external=true" title="class or interface in java.lang">NoSuchMethodException</A></CODE></DL> 414</DD> 415</DL> 416<!-- ========= END OF CLASS DATA ========= --> 417<HR> 418 419 420<!-- ======= START OF BOTTOM NAVBAR ====== --> 421<A NAME="navbar_bottom"><!-- --></A> 422<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 423<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 424<TR> 425<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 426<A NAME="navbar_bottom_firstrow"><!-- --></A> 427<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 428 <TR ALIGN="center" VALIGN="top"> 429 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 430 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 431 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 432 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 433 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 434 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 435 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 436 </TR> 437</TABLE> 438</TD> 439<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 440</EM> 441</TD> 442</TR> 443 444<TR> 445<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 446 PREV CLASS 447 NEXT CLASS</FONT></TD> 448<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 449 <A HREF="../../../../index.html?com/google/dexmaker/stock/ProxyBuilder.html" target="_top"><B>FRAMES</B></A> 450 <A HREF="ProxyBuilder.html" target="_top"><B>NO FRAMES</B></A> 451 <SCRIPT type="text/javascript"> 452 <!-- 453 if(window==top) { 454 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 455 } 456 //--> 457</SCRIPT> 458<NOSCRIPT> 459 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 460</NOSCRIPT> 461 462 463</FONT></TD> 464</TR> 465<TR> 466<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 467 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 468<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 469DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> 470</TR> 471</TABLE> 472<A NAME="skip-navbar_bottom"></A> 473<!-- ======== END OF BOTTOM NAVBAR ======= --> 474 475<HR> 476 477</BODY> 478</HTML> 479