<!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.4.2_16) on Fri Nov 19 12:15:47 PST 2010 --> <TITLE> Introspector (Velocity 1.7 API) </TITLE> <META NAME="keywords" CONTENT="org.apache.velocity.util.introspection.Introspector class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Introspector (Velocity 1.7 API)"; } </SCRIPT> </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=3 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="class-use/Introspector.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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/velocity/util/introspection/IntrospectionUtils.html" title="class in org.apache.velocity.util.introspection"><B>PREV CLASS</B></A> <A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html" title="class in org.apache.velocity.util.introspection"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="Introspector.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="#fields_inherited_from_class_org.apache.velocity.util.introspection.IntrospectorBase">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: FIELD | <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.util.introspection</FONT> <BR> Class Introspector</H2> <PRE> <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html" title="class in org.apache.velocity.util.introspection">org.apache.velocity.util.introspection.IntrospectorBase</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.velocity.util.introspection.Introspector</B> </PRE> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/velocity/util/introspection/SecureIntrospectorImpl.html" title="class in org.apache.velocity.util.introspection">SecureIntrospectorImpl</A></DD> </DL> <HR> <DL> <DT>public class <B>Introspector</B><DT>extends <A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html" title="class in org.apache.velocity.util.introspection">IntrospectorBase</A></DL> <P> This basic function of this class is to return a Method object for a particular class given the name of a method and the parameters to the method in the form of an Object[] The first time the Introspector sees a class it creates a class method map for the class in question. Basically the class method map is a Hastable where Method objects are keyed by a concatenation of the method name and the names of classes that make up the parameters. For example, a method with the following signature: public void method(String a, StringBuffer b) would be mapped by the key: "method" + "java.lang.String" + "java.lang.StringBuffer" This mapping is performed for all the methods in a class and stored for <P> <P> <DL> <DT><B>Version:</B></DT> <DD>$Id: Introspector.java 687177 2008-08-19 22:00:32Z nbubna $</DD> <DT><B>Author:</B></DT> <DD><a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>, <a href="mailto:bob@werken.com">Bob McWhirter</a>, <a href="mailto:szegedia@freemail.hu">Attila Szegedi</a>, <a href="mailto:paulo.gaspar@krankikom.de">Paulo Gaspar</a>, <a href="mailto:henning@apache.org">Henning P. Schmiedehausen</a></DD> </DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> </TABLE> <A NAME="fields_inherited_from_class_org.apache.velocity.util.introspection.IntrospectorBase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Fields inherited from class org.apache.velocity.util.introspection.<A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html" title="class in org.apache.velocity.util.introspection">IntrospectorBase</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html#log">log</A></CODE></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"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/velocity/util/introspection/Introspector.html#Introspector(org.apache.velocity.runtime.log.Log)">Introspector</A></B>(<A HREF="../../../../../org/apache/velocity/runtime/log/Log.html" title="class in org.apache.velocity.runtime.log">Log</A> log)</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/velocity/util/introspection/Introspector.html#Introspector(org.apache.velocity.runtime.RuntimeLogger)">Introspector</A></B>(<A HREF="../../../../../org/apache/velocity/runtime/RuntimeLogger.html" title="interface in org.apache.velocity.runtime">RuntimeLogger</A> logger)</CODE> <BR> <B>Deprecated.</B> <I>RuntimeLogger is deprecated. Use Introspector(Log log).</I></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"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Method.html" title="class or interface in java.lang.reflect">Method</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/velocity/util/introspection/Introspector.html#getMethod(java.lang.Class, java.lang.String, java.lang.Object[])">getMethod</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> c, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] params)</CODE> <BR> Gets the method defined by <code>name</code> and <code>params</code> for the Class <code>c</code>.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_org.apache.velocity.util.introspection.IntrospectorBase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class org.apache.velocity.util.introspection.<A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html" title="class in org.apache.velocity.util.introspection">IntrospectorBase</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html#getIntrospectorCache()">getIntrospectorCache</A></CODE></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"> <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="Introspector(org.apache.velocity.runtime.log.Log)"><!-- --></A><H3> Introspector</H3> <PRE> public <B>Introspector</B>(<A HREF="../../../../../org/apache/velocity/runtime/log/Log.html" title="class in org.apache.velocity.runtime.log">Log</A> log)</PRE> <DL> <DT><B>Parameters:</B><DD><CODE>log</CODE> - A Log object to use for the introspector.<DT><B>Since:</B></DT> <DD>1.5</DD> </DL> <HR> <A NAME="Introspector(org.apache.velocity.runtime.RuntimeLogger)"><!-- --></A><H3> Introspector</H3> <PRE> public <B>Introspector</B>(<A HREF="../../../../../org/apache/velocity/runtime/RuntimeLogger.html" title="interface in org.apache.velocity.runtime">RuntimeLogger</A> logger)</PRE> <DL> <DD><B>Deprecated.</B> <I>RuntimeLogger is deprecated. Use Introspector(Log log).</I> <P> <DT><B>Parameters:</B><DD><CODE>logger</CODE> - A runtime logger object.</DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="getMethod(java.lang.Class, java.lang.String, java.lang.Object[])"><!-- --></A><H3> getMethod</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Method.html" title="class or interface in java.lang.reflect">Method</A> <B>getMethod</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> c, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] params) throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></PRE> <DL> <DD>Gets the method defined by <code>name</code> and <code>params</code> for the Class <code>c</code>. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html#getMethod(java.lang.Class, java.lang.String, java.lang.Object[])">getMethod</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html" title="class in org.apache.velocity.util.introspection">IntrospectorBase</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>c</CODE> - Class in which the method search is taking place<DD><CODE>name</CODE> - Name of the method being searched for<DD><CODE>params</CODE> - An array of Objects (not Classes) that describe the the parameters <DT><B>Returns:</B><DD>The desired Method object. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - When the parameters passed in can not be used for introspection.</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=3 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="class-use/Introspector.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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/velocity/util/introspection/IntrospectionUtils.html" title="class in org.apache.velocity.util.introspection"><B>PREV CLASS</B></A> <A HREF="../../../../../org/apache/velocity/util/introspection/IntrospectorBase.html" title="class in org.apache.velocity.util.introspection"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="Introspector.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="#fields_inherited_from_class_org.apache.velocity.util.introspection.IntrospectorBase">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: FIELD | <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 © 2000-2010 <a href=http://www.apache.org/>Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>