<!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_14) on Mon Apr 26 10:16:11 PDT 2010 --> | |
<TITLE> | |
ClassUtils (VelocityTools 2.0 Documentation) | |
</TITLE> | |
<META NAME="keywords" CONTENT="org.apache.velocity.tools.ClassUtils class"> | |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> | |
<SCRIPT type="text/javascript"> | |
function windowTitle() | |
{ | |
parent.document.title="ClassUtils (VelocityTools 2.0 Documentation)"; | |
} | |
</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"> | |
PREV CLASS | |
<A HREF="../../../../org/apache/velocity/tools/ConversionUtils.html" title="class in org.apache.velocity.tools"><B>NEXT CLASS</B></A></FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../index.html?org/apache/velocity/tools/ClassUtils.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="ClassUtils.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: NESTED | <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.velocity.tools</FONT> | |
<BR> | |
Class ClassUtils</H2> | |
<PRE> | |
java.lang.Object | |
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.velocity.tools.ClassUtils</B> | |
</PRE> | |
<HR> | |
<DL> | |
<DT><PRE>public class <B>ClassUtils</B><DT>extends java.lang.Object</DL> | |
</PRE> | |
<P> | |
Repository for common class and reflection methods. | |
<P> | |
<P> | |
<DL> | |
<DT><B>Version:</B></DT> | |
<DD>$Id: ClassUtils.java 511959 2007-02-26 19:24:39Z nbubna $</DD> | |
<DT><B>Author:</B></DT> | |
<DD>Nathan Bubna</DD> | |
</DL> | |
<HR> | |
<P> | |
<!-- =========== 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 <A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools">ClassUtils</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#INSTANCE">INSTANCE</A></B></CODE> | |
<BR> | |
</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 ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private </CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#ClassUtils()">ClassUtils</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>private static void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#addResource(java.lang.String, java.util.Set, java.lang.Class)">addResource</A></B>(java.lang.String name, | |
java.util.Set<java.lang.String> urls, | |
java.lang.Class c)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private static boolean</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#addResources(java.lang.String, java.util.Set, java.lang.ClassLoader)">addResources</A></B>(java.lang.String name, | |
java.util.Set<java.lang.String> urls, | |
java.lang.ClassLoader loader)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.lang.reflect.Method</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#findDeclaredMethod(java.lang.Class, java.lang.String, java.lang.Class[])">findDeclaredMethod</A></B>(java.lang.Class clazz, | |
java.lang.String name, | |
java.lang.Class[] params)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.lang.reflect.Method</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#findMethod(java.lang.Class, java.lang.String, java.lang.Class[])">findMethod</A></B>(java.lang.Class clazz, | |
java.lang.String name, | |
java.lang.Class[] params)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private static java.lang.ClassLoader</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getCallerLoader(java.lang.Object)">getCallerLoader</A></B>(java.lang.Object caller)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.lang.Class</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getClass(java.lang.String)">getClass</A></B>(java.lang.String name)</CODE> | |
<BR> | |
Load a class with a given name.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private static java.lang.ClassLoader</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getClassLoader()">getClassLoader</A></B>()</CODE> | |
<BR> | |
</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/velocity/tools/ClassUtils.html#getFieldValue(java.lang.Class, java.lang.String)">getFieldValue</A></B>(java.lang.Class clazz, | |
java.lang.String fieldname)</CODE> | |
<BR> | |
</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/velocity/tools/ClassUtils.html#getFieldValue(java.lang.String)">getFieldValue</A></B>(java.lang.String fieldPath)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> <A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools">ClassUtils</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getInstance()">getInstance</A></B>()</CODE> | |
<BR> | |
</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/velocity/tools/ClassUtils.html#getInstance(java.lang.String)">getInstance</A></B>(java.lang.String classname)</CODE> | |
<BR> | |
</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.util.Iterator</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getIterator(java.lang.Object)">getIterator</A></B>(java.lang.Object obj)</CODE> | |
<BR> | |
Retrieves an Iterator from or creates and Iterator for the specified object.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.net.URL</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getResource(java.lang.String, java.lang.Object)">getResource</A></B>(java.lang.String name, | |
java.lang.Object caller)</CODE> | |
<BR> | |
Load a given resource.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.io.InputStream</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getResourceAsStream(java.lang.String, java.lang.Object)">getResourceAsStream</A></B>(java.lang.String name, | |
java.lang.Object caller)</CODE> | |
<BR> | |
This is a convenience method to load a resource as a stream.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>static java.util.List<java.net.URL></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getResources(java.lang.String, java.lang.Object)">getResources</A></B>(java.lang.String name, | |
java.lang.Object caller)</CODE> | |
<BR> | |
Load all resources with the specified name.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>private static java.lang.ClassLoader</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getThreadContextLoader()">getThreadContextLoader</A></B>()</CODE> | |
<BR> | |
</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="INSTANCE"><!-- --></A><H3> | |
INSTANCE</H3> | |
<PRE> | |
public static final <A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools">ClassUtils</A> <B>INSTANCE</B></PRE> | |
<DL> | |
<DL> | |
</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="ClassUtils()"><!-- --></A><H3> | |
ClassUtils</H3> | |
<PRE> | |
private <B>ClassUtils</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="getInstance()"><!-- --></A><H3> | |
getInstance</H3> | |
<PRE> | |
public <A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools">ClassUtils</A> <B>getInstance</B>()</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getThreadContextLoader()"><!-- --></A><H3> | |
getThreadContextLoader</H3> | |
<PRE> | |
private static final java.lang.ClassLoader <B>getThreadContextLoader</B>()</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getClassLoader()"><!-- --></A><H3> | |
getClassLoader</H3> | |
<PRE> | |
private static final java.lang.ClassLoader <B>getClassLoader</B>()</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getCallerLoader(java.lang.Object)"><!-- --></A><H3> | |
getCallerLoader</H3> | |
<PRE> | |
private static final java.lang.ClassLoader <B>getCallerLoader</B>(java.lang.Object caller)</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getClass(java.lang.String)"><!-- --></A><H3> | |
getClass</H3> | |
<PRE> | |
public static java.lang.Class <B>getClass</B>(java.lang.String name) | |
throws java.lang.ClassNotFoundException</PRE> | |
<DL> | |
<DD>Load a class with a given name. | |
<p/> | |
It will try to load the class in the following order: | |
<ul> | |
<li>From <CODE>Thread</CODE>.currentThread().getContextClassLoader() | |
<li>Using the basic <CODE>Class.forName(java.lang.String)</CODE> | |
<li>From <A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools"><CODE>ClassUtils</CODE></A>.class.getClassLoader() | |
</ul> | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - Fully qualified class name to be loaded | |
<DT><B>Returns:</B><DD>Class object | |
<DT><B>Throws:</B> | |
<DD><CODE>java.lang.ClassNotFoundException</CODE> - if the class cannot be found</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getInstance(java.lang.String)"><!-- --></A><H3> | |
getInstance</H3> | |
<PRE> | |
public static java.lang.Object <B>getInstance</B>(java.lang.String classname) | |
throws java.lang.ClassNotFoundException, | |
java.lang.IllegalAccessException, | |
java.lang.InstantiationException</PRE> | |
<DL> | |
<DD><DL> | |
<DT><B>Throws:</B> | |
<DD><CODE>java.lang.ClassNotFoundException</CODE> | |
<DD><CODE>java.lang.IllegalAccessException</CODE> | |
<DD><CODE>java.lang.InstantiationException</CODE></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getResources(java.lang.String, java.lang.Object)"><!-- --></A><H3> | |
getResources</H3> | |
<PRE> | |
public static java.util.List<java.net.URL> <B>getResources</B>(java.lang.String name, | |
java.lang.Object caller)</PRE> | |
<DL> | |
<DD>Load all resources with the specified name. If none are found, we | |
prepend the name with '/' and try again. | |
This will attempt to load the resources from the following methods (in order): | |
<ul> | |
<li>Thread.currentThread().getContextClassLoader().getResources(name)</li> | |
<li><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools"><CODE>ClassUtils</CODE></A>.class.getClassLoader().getResources(name)</li> | |
<li><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools"><CODE>ClassUtils</CODE></A>.class.getResource(name)</li> | |
<li><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html#getCallerLoader(java.lang.Object)"><CODE>getCallerLoader(Object caller)</CODE></A>.getResources(name)</li> | |
<li>caller.getClass().getResource(name)</li> | |
</ul> | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The name of the resources to load<DD><CODE>caller</CODE> - The instance or <CODE>Class</CODE> calling this method</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="addResource(java.lang.String, java.util.Set, java.lang.Class)"><!-- --></A><H3> | |
addResource</H3> | |
<PRE> | |
private static final void <B>addResource</B>(java.lang.String name, | |
java.util.Set<java.lang.String> urls, | |
java.lang.Class c)</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="addResources(java.lang.String, java.util.Set, java.lang.ClassLoader)"><!-- --></A><H3> | |
addResources</H3> | |
<PRE> | |
private static final boolean <B>addResources</B>(java.lang.String name, | |
java.util.Set<java.lang.String> urls, | |
java.lang.ClassLoader loader)</PRE> | |
<DL> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getResource(java.lang.String, java.lang.Object)"><!-- --></A><H3> | |
getResource</H3> | |
<PRE> | |
public static java.net.URL <B>getResource</B>(java.lang.String name, | |
java.lang.Object caller)</PRE> | |
<DL> | |
<DD>Load a given resource. | |
<p/> | |
This method will try to load the resource using the following methods (in order): | |
<ul> | |
<li>Thread.currentThread().getContextClassLoader().getResource(name)</li> | |
<li><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools"><CODE>ClassUtils</CODE></A>.class.getClassLoader().getResource(name)</li> | |
<li><A HREF="../../../../org/apache/velocity/tools/ClassUtils.html" title="class in org.apache.velocity.tools"><CODE>ClassUtils</CODE></A>.class.getResource(name)</li> | |
<li>caller.getClass().getResource(name) or, if caller is a Class, | |
caller.getResource(name)</li> | |
</ul> | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The name of the resource to load<DD><CODE>caller</CODE> - The instance or <CODE>Class</CODE> calling this method</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getResourceAsStream(java.lang.String, java.lang.Object)"><!-- --></A><H3> | |
getResourceAsStream</H3> | |
<PRE> | |
public static java.io.InputStream <B>getResourceAsStream</B>(java.lang.String name, | |
java.lang.Object caller)</PRE> | |
<DL> | |
<DD>This is a convenience method to load a resource as a stream. | |
<p/> | |
The algorithm used to find the resource is given in getResource() | |
<P> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The name of the resource to load<DD><CODE>caller</CODE> - The instance or <CODE>Class</CODE> calling this method</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="findMethod(java.lang.Class, java.lang.String, java.lang.Class[])"><!-- --></A><H3> | |
findMethod</H3> | |
<PRE> | |
public static java.lang.reflect.Method <B>findMethod</B>(java.lang.Class clazz, | |
java.lang.String name, | |
java.lang.Class[] params) | |
throws java.lang.SecurityException</PRE> | |
<DL> | |
<DD><DL> | |
<DT><B>Throws:</B> | |
<DD><CODE>java.lang.SecurityException</CODE></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="findDeclaredMethod(java.lang.Class, java.lang.String, java.lang.Class[])"><!-- --></A><H3> | |
findDeclaredMethod</H3> | |
<PRE> | |
public static java.lang.reflect.Method <B>findDeclaredMethod</B>(java.lang.Class clazz, | |
java.lang.String name, | |
java.lang.Class[] params) | |
throws java.lang.SecurityException</PRE> | |
<DL> | |
<DD><DL> | |
<DT><B>Throws:</B> | |
<DD><CODE>java.lang.SecurityException</CODE></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getFieldValue(java.lang.String)"><!-- --></A><H3> | |
getFieldValue</H3> | |
<PRE> | |
public static java.lang.Object <B>getFieldValue</B>(java.lang.String fieldPath) | |
throws java.lang.ClassNotFoundException, | |
java.lang.NoSuchFieldException, | |
java.lang.SecurityException, | |
java.lang.IllegalAccessException</PRE> | |
<DL> | |
<DD><DL> | |
<DT><B>Throws:</B> | |
<DD><CODE>java.lang.ClassNotFoundException</CODE> | |
<DD><CODE>java.lang.NoSuchFieldException</CODE> | |
<DD><CODE>java.lang.SecurityException</CODE> | |
<DD><CODE>java.lang.IllegalAccessException</CODE></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getFieldValue(java.lang.Class, java.lang.String)"><!-- --></A><H3> | |
getFieldValue</H3> | |
<PRE> | |
public static java.lang.Object <B>getFieldValue</B>(java.lang.Class clazz, | |
java.lang.String fieldname) | |
throws java.lang.NoSuchFieldException, | |
java.lang.SecurityException, | |
java.lang.IllegalAccessException</PRE> | |
<DL> | |
<DD><DL> | |
<DT><B>Throws:</B> | |
<DD><CODE>java.lang.NoSuchFieldException</CODE> | |
<DD><CODE>java.lang.SecurityException</CODE> | |
<DD><CODE>java.lang.IllegalAccessException</CODE></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getIterator(java.lang.Object)"><!-- --></A><H3> | |
getIterator</H3> | |
<PRE> | |
public static java.util.Iterator <B>getIterator</B>(java.lang.Object obj) | |
throws java.lang.NoSuchMethodException, | |
java.lang.IllegalAccessException, | |
java.lang.reflect.InvocationTargetException</PRE> | |
<DL> | |
<DD>Retrieves an Iterator from or creates and Iterator for the specified object. | |
This method is almost entirely copied from Engine's UberspectImpl class. | |
<P> | |
<DD><DL> | |
<DT><B>Throws:</B> | |
<DD><CODE>java.lang.NoSuchMethodException</CODE> | |
<DD><CODE>java.lang.IllegalAccessException</CODE> | |
<DD><CODE>java.lang.reflect.InvocationTargetException</CODE></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"> | |
PREV CLASS | |
<A HREF="../../../../org/apache/velocity/tools/ConversionUtils.html" title="class in org.apache.velocity.tools"><B>NEXT CLASS</B></A></FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../index.html?org/apache/velocity/tools/ClassUtils.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="ClassUtils.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: NESTED | <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> | |
Copyright (c) 2003-2007 Apache Software Foundation | |
</BODY> | |
</HTML> |