Edit C:\apache-ant-1.8.0\docs\manual\api\org\apache\tools\ant\util\ClasspathUtils.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_22) on Mon Feb 01 19:35:59 EST 2010 --> <TITLE> ClasspathUtils (Apache Ant API) </TITLE> <META NAME="keywords" CONTENT="org.apache.tools.ant.util.ClasspathUtils class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="ClasspathUtils (Apache Ant API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../org/apache/tools/ant/util/ChainedMapper.html" title="class in org.apache.tools.ant.util"><B>PREV CLASS</B></A> <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.Delegate.html" title="class in org.apache.tools.ant.util"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/tools/ant/util/ClasspathUtils.html" target="_top"><B>FRAMES</B></A> <A HREF="ClasspathUtils.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.tools.ant.util</FONT> <BR> Class ClasspathUtils</H2> <PRE> java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.tools.ant.util.ClasspathUtils</B> </PRE> <HR> <DL> <DT><PRE>public class <B>ClasspathUtils</B><DT>extends java.lang.Object</DL> </PRE> <P> Offers some helper methods on the Path structure in ant. <p>The basic idea behind this utility class is to use it from inside the different Ant objects (and user defined objects) that need classLoading for their operation. Normally those would have a setClasspathRef() {for the @classpathref} and/or a createClasspath() {for the nested <classpath>} Typically one would have in your Ant Task or DataType</p> <pre><code> ClasspathUtils.Delegate cpDelegate; public void init() { this.cpDelegate = ClasspathUtils.getDelegate(this); super.init(); } public void setClasspathRef(Reference r) { this.cpDelegate.setClasspathRef(r); } public Path createClasspath() { return this.cpDelegate.createClasspath(); } public void setClassname(String fqcn) { this.cpDelegate.setClassname(fqcn); } </code></pre> <p>At execution time, when you actually need the classloading you can just:</p> <pre><code> Object o = this.cpDelegate.newInstance(); </code></pre> <P> <P> <DL> <DT><B>Since:</B></DT> <DD>Ant 1.6</DD> </DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <A NAME="nested_class_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Nested Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.Delegate.html" title="class in org.apache.tools.ant.util">ClasspathUtils.Delegate</A></B></CODE> <BR> Delegate that helps out any specific ProjectComponent that needs dynamic classloading.</TD> </TR> </TABLE> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#REUSE_LOADER_REF">REUSE_LOADER_REF</A></B></CODE> <BR> Name of the magic property that controls classloader reuse in Ant 1.4.</TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#ClasspathUtils()">ClasspathUtils</A></B>()</CODE> <BR> </TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.ClassLoader</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String)">getClassLoaderForPath</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, java.lang.String loaderId)</CODE> <BR> Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean)"><CODE>getClassLoaderForPath(Project, Path, String, boolean)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.ClassLoader</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean)">getClassLoaderForPath</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, java.lang.String loaderId, boolean reverseLoader)</CODE> <BR> Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean, boolean)"><CODE>getClassLoaderForPath(Project, Path, String, boolean, boolean)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.ClassLoader</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean, boolean)">getClassLoaderForPath</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, java.lang.String loaderId, boolean reverseLoader, boolean reuseLoader)</CODE> <BR> Gets a classloader that loads classes from the classpath defined in the path argument.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.ClassLoader</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Reference)">getClassLoaderForPath</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Reference.html" title="class in org.apache.tools.ant.types">Reference</A> ref)</CODE> <BR> Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Reference, boolean)"><CODE>getClassLoaderForPath(Project, Reference, boolean)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.ClassLoader</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Reference, boolean)">getClassLoaderForPath</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Reference.html" title="class in org.apache.tools.ant.types">Reference</A> ref, boolean reverseLoader)</CODE> <BR> Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean)"><CODE>getClassLoaderForPath(Project, Path, String, boolean)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.Delegate.html" title="class in org.apache.tools.ant.util">ClasspathUtils.Delegate</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getDelegate(org.apache.tools.ant.ProjectComponent)">getDelegate</A></B>(<A HREF="../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</A> component)</CODE> <BR> Obtains a delegate that helps out with classic classpath configuration.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.ClassLoader</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getUniqueClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, boolean)">getUniqueClassLoaderForPath</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, boolean reverseLoader)</CODE> <BR> Gets a fresh, different, previously unused classloader that uses the passed path as its classpath.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#newInstance(java.lang.String, java.lang.ClassLoader)">newInstance</A></B>(java.lang.String className, java.lang.ClassLoader userDefinedLoader)</CODE> <BR> Creates a fresh object instance of the specified classname.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#newInstance(java.lang.String, java.lang.ClassLoader, java.lang.Class)">newInstance</A></B>(java.lang.String className, java.lang.ClassLoader userDefinedLoader, java.lang.Class expectedType)</CODE> <BR> Creates a fresh object instance of the specified classname.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="REUSE_LOADER_REF"><!-- --></A><H3> REUSE_LOADER_REF</H3> <PRE> public static final java.lang.String <B>REUSE_LOADER_REF</B></PRE> <DL> <DD>Name of the magic property that controls classloader reuse in Ant 1.4. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.tools.ant.util.ClasspathUtils.REUSE_LOADER_REF">Constant Field Values</A></DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="ClasspathUtils()"><!-- --></A><H3> ClasspathUtils</H3> <PRE> public <B>ClasspathUtils</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Reference)"><!-- --></A><H3> getClassLoaderForPath</H3> <PRE> public static java.lang.ClassLoader <B>getClassLoaderForPath</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Reference.html" title="class in org.apache.tools.ant.types">Reference</A> ref)</PRE> <DL> <DD>Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Reference, boolean)"><CODE>getClassLoaderForPath(Project, Reference, boolean)</CODE></A>. <p>Assumes the logical 'false' for the reverseLoader.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - the project<DD><CODE>ref</CODE> - the reference <DT><B>Returns:</B><DD>The class loader</DL> </DD> </DL> <HR> <A NAME="getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Reference, boolean)"><!-- --></A><H3> getClassLoaderForPath</H3> <PRE> public static java.lang.ClassLoader <B>getClassLoaderForPath</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Reference.html" title="class in org.apache.tools.ant.types">Reference</A> ref, boolean reverseLoader)</PRE> <DL> <DD>Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean)"><CODE>getClassLoaderForPath(Project, Path, String, boolean)</CODE></A>. <p>Delegates to the other one after extracting the referenced Path from the Project. This checks also that the passed Reference is pointing to a Path all right.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - current Ant project<DD><CODE>ref</CODE> - Reference to Path structure<DD><CODE>reverseLoader</CODE> - if set to true this new loader will take precedence over its parent (which is contra the regular classloader behaviour) <DT><B>Returns:</B><DD>The class loader</DL> </DD> </DL> <HR> <A NAME="getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String)"><!-- --></A><H3> getClassLoaderForPath</H3> <PRE> public static java.lang.ClassLoader <B>getClassLoaderForPath</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, java.lang.String loaderId)</PRE> <DL> <DD>Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean)"><CODE>getClassLoaderForPath(Project, Path, String, boolean)</CODE></A>. <p>Assumes the logical 'false' for the reverseLoader.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - current Ant project<DD><CODE>path</CODE> - the path<DD><CODE>loaderId</CODE> - the loader id string <DT><B>Returns:</B><DD>The class loader</DL> </DD> </DL> <HR> <A NAME="getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean)"><!-- --></A><H3> getClassLoaderForPath</H3> <PRE> public static java.lang.ClassLoader <B>getClassLoaderForPath</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, java.lang.String loaderId, boolean reverseLoader)</PRE> <DL> <DD>Convenience overloaded version of <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.html#getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean, boolean)"><CODE>getClassLoaderForPath(Project, Path, String, boolean, boolean)</CODE></A>. <p>Sets value for 'reuseLoader' to true if the magic property has been set.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - the project<DD><CODE>path</CODE> - the path<DD><CODE>loaderId</CODE> - the loader id string<DD><CODE>reverseLoader</CODE> - if set to true this new loader will take precedence over its parent (which is contra the regular classloader behaviour) <DT><B>Returns:</B><DD>The class loader</DL> </DD> </DL> <HR> <A NAME="getClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, java.lang.String, boolean, boolean)"><!-- --></A><H3> getClassLoaderForPath</H3> <PRE> public static java.lang.ClassLoader <B>getClassLoaderForPath</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, java.lang.String loaderId, boolean reverseLoader, boolean reuseLoader)</PRE> <DL> <DD>Gets a classloader that loads classes from the classpath defined in the path argument. <p>Based on the setting of the magic property 'ant.reuse.loader' this will try to reuse the previously created loader with that id, and of course store it there upon creation.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - Ant Project where the handled components are living in.<DD><CODE>path</CODE> - Path object to be used as classpath for this classloader<DD><CODE>loaderId</CODE> - identification for this Loader,<DD><CODE>reverseLoader</CODE> - if set to true this new loader will take precedence over its parent (which is contra the regular classloader behaviour)<DD><CODE>reuseLoader</CODE> - if true reuse the loader if it is found <DT><B>Returns:</B><DD>ClassLoader that uses the Path as its classpath.</DL> </DD> </DL> <HR> <A NAME="getUniqueClassLoaderForPath(org.apache.tools.ant.Project, org.apache.tools.ant.types.Path, boolean)"><!-- --></A><H3> getUniqueClassLoaderForPath</H3> <PRE> public static java.lang.ClassLoader <B>getUniqueClassLoaderForPath</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> p, <A HREF="../../../../../org/apache/tools/ant/types/Path.html" title="class in org.apache.tools.ant.types">Path</A> path, boolean reverseLoader)</PRE> <DL> <DD>Gets a fresh, different, previously unused classloader that uses the passed path as its classpath. <p>This method completely ignores the ant.reuse.loader magic property and should be used with caution.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - Ant Project where the handled components are living in.<DD><CODE>path</CODE> - the classpath for this loader<DD><CODE>reverseLoader</CODE> - if set to true this new loader will take precedence over its parent (which is contra the regular classloader behaviour) <DT><B>Returns:</B><DD>The fresh, different, previously unused class loader.</DL> </DD> </DL> <HR> <A NAME="newInstance(java.lang.String, java.lang.ClassLoader)"><!-- --></A><H3> newInstance</H3> <PRE> public static java.lang.Object <B>newInstance</B>(java.lang.String className, java.lang.ClassLoader userDefinedLoader)</PRE> <DL> <DD>Creates a fresh object instance of the specified classname. <p> This uses the userDefinedLoader to load the specified class, and then makes an instance using the default no-argument constructor. </p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>className</CODE> - the full qualified class name to load.<DD><CODE>userDefinedLoader</CODE> - the classloader to use. <DT><B>Returns:</B><DD>The fresh object instance <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></CODE> - when loading or instantiation failed.</DL> </DD> </DL> <HR> <A NAME="newInstance(java.lang.String, java.lang.ClassLoader, java.lang.Class)"><!-- --></A><H3> newInstance</H3> <PRE> public static java.lang.Object <B>newInstance</B>(java.lang.String className, java.lang.ClassLoader userDefinedLoader, java.lang.Class expectedType)</PRE> <DL> <DD>Creates a fresh object instance of the specified classname. <p> This uses the userDefinedLoader to load the specified class, and then makes an instance using the default no-argument constructor. </p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>className</CODE> - the full qualified class name to load.<DD><CODE>userDefinedLoader</CODE> - the classloader to use.<DD><CODE>expectedType</CODE> - the Class that the result should be assignment compatible with. (No ClassCastException will be thrown in case the result of this method is casted to the expectedType) <DT><B>Returns:</B><DD>The fresh object instance <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></CODE> - when loading or instantiation failed.<DT><B>Since:</B></DT> <DD>Ant 1.7</DD> </DL> </DD> </DL> <HR> <A NAME="getDelegate(org.apache.tools.ant.ProjectComponent)"><!-- --></A><H3> getDelegate</H3> <PRE> public static <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.Delegate.html" title="class in org.apache.tools.ant.util">ClasspathUtils.Delegate</A> <B>getDelegate</B>(<A HREF="../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</A> component)</PRE> <DL> <DD>Obtains a delegate that helps out with classic classpath configuration. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>component</CODE> - your projectComponent that needs the assistence <DT><B>Returns:</B><DD>the helper, delegate.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.Delegate.html" title="class in org.apache.tools.ant.util"><CODE>ClasspathUtils.Delegate</CODE></A></DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../org/apache/tools/ant/util/ChainedMapper.html" title="class in org.apache.tools.ant.util"><B>PREV CLASS</B></A> <A HREF="../../../../../org/apache/tools/ant/util/ClasspathUtils.Delegate.html" title="class in org.apache.tools.ant.util"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/tools/ant/util/ClasspathUtils.html" target="_top"><B>FRAMES</B></A> <A HREF="ClasspathUtils.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de