blob: 194e0f86745d3de16563d67c6718dda7b4693ccf [file] [log] [blame]
<!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.6.0_33) on Sun Jul 29 12:18:26 PDT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
ResolverUtil (Log4J Core 2.0-alpha1 API)
</TITLE>
<META NAME="date" CONTENT="2012-07-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ResolverUtil (Log4J Core 2.0-alpha1 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= 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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ResolverUtil.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/PropertiesPlugin.html" title="class in org.apache.logging.log4j.core.config.plugins"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.AnnotatedWith.html" title="class in org.apache.logging.log4j.core.config.plugins"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/logging/log4j/core/config/plugins/ResolverUtil.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ResolverUtil.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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.logging.log4j.core.config.plugins</FONT>
<BR>
Class ResolverUtil&lt;T&gt;</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.logging.log4j.core.config.plugins.ResolverUtil&lt;T&gt;</B>
</PRE>
<DL>
<DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - The type of the Class that can be returned.</DL>
<HR>
<DL>
<DT><PRE>public class <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.71"><B>ResolverUtil&lt;T&gt;</B></A><DT>extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
<p>ResolverUtil is used to locate classes that are available in the/a class path and meet
arbitrary conditions. The two most common conditions are that a class implements/extends
another class, or that is it annotated with a specific annotation. However, through the use
of the <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins"><CODE>ResolverUtil.Test</CODE></A> class it is possible to search using arbitrary conditions.</p>
<p>A ClassLoader is used to locate all locations (directories and jar files) in the class
path that contain classes within certain packages, and then to load those classes and
check them. By default the ClassLoader returned by
<code>Thread.currentThread().getContextClassLoader()</code> is used, but this can be overridden
by calling <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#setClassLoader(java.lang.ClassLoader)"><CODE>setClassLoader(ClassLoader)</CODE></A> prior to invoking any of the <code>find()</code>
methods.</p>
<p>General searches are initiated by calling the
<CODE>#find(org.apache.logging.log4j.core..util.ResolverUtil.Test, String...)</CODE> ()} method and supplying
a package name and a Test instance. This will cause the named package <b>and all sub-packages</b>
to be scanned for classes that meet the test. There are also utility methods for the common
use cases of scanning multiple packages for extensions of particular classes, or classes
annotated with a specific annotation.</p>
<p>The standard usage pattern for the ResolverUtil class is as follows:</p>
<pre>
ResolverUtil&lt;ActionBean&gt; resolver = new ResolverUtil&lt;ActionBean&gt;();
resolver.findImplementation(ActionBean.class, pkg1, pkg2);
resolver.find(new CustomTest(), pkg1);
resolver.find(new CustomTest(), pkg2);
Collection&lt;ActionBean&gt; beans = resolver.getClasses();
</pre>
<p>This class was copied from Stripes - http://stripes.mc4j.org/confluence/display/stripes/Home
</p>
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Tim Fennell</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&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.AnnotatedWith.html" title="class in org.apache.logging.log4j.core.config.plugins">ResolverUtil.AnnotatedWith</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Test that checks to see if each class is annotated with a specific annotation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.ClassTest.html" title="class in org.apache.logging.log4j.core.config.plugins">ResolverUtil.ClassTest</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Test against a Class.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.IsA.html" title="class in org.apache.logging.log4j.core.config.plugins">ResolverUtil.IsA</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Test that checks to see if each class is assignable to the provided class.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.NameEndsWith.html" title="class in org.apache.logging.log4j.core.config.plugins">ResolverUtil.NameEndsWith</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Test that checks to see if each class name ends with the provided suffix.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.NameIs.html" title="class in org.apache.logging.log4j.core.config.plugins">ResolverUtil.NameIs</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Test that checks to see if the class name matches.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.ResourceTest.html" title="class in org.apache.logging.log4j.core.config.plugins">ResolverUtil.ResourceTest</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Test against a resource.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;interface</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins">ResolverUtil.Test</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A simple interface that specifies how to test classes to determine if they
are to be included in the results produced by the ResolverUtil.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== 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/logging/log4j/core/config/plugins/ResolverUtil.html#ResolverUtil()">ResolverUtil</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#addIfMatching(org.apache.logging.log4j.core.config.plugins.ResolverUtil.Test, java.lang.String)">addIfMatching</A></B>(<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins">ResolverUtil.Test</A>&nbsp;test,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;fqn)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add the class designated by the fully qualified class name provided to the set of
resolved classes if and only if it is approved by the Test supplied.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#find(org.apache.logging.log4j.core.config.plugins.ResolverUtil.Test, java.lang.String...)">find</A></B>(<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins">ResolverUtil.Test</A>&nbsp;test,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempts to discover classes that pass the test.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#findAnnotated(java.lang.Class, java.lang.String...)">findAnnotated</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</A>&gt;&nbsp;annotation,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempts to discover classes that are annotated with to the annotation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#findImplementations(java.lang.Class, java.lang.String...)">findImplementations</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;parent,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempts to discover classes that are assignable to the type provided.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#findInPackage(org.apache.logging.log4j.core.config.plugins.ResolverUtil.Test, java.lang.String)">findInPackage</A></B>(<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins">ResolverUtil.Test</A>&nbsp;test,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;packageName)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scans for classes starting at the package provided and descending into subpackages.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#findNamedResource(java.lang.String, java.lang.String...)">findNamedResource</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;pathNames)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#findSuffix(java.lang.String, java.lang.String...)">findSuffix</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;suffix,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempts to discover classes who's name ends with the provided suffix.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html" title="type parameter in ResolverUtil">T</A>&gt;&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getClasses()">getClasses</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provides access to the classes discovered so far.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getClassLoader()">getClassLoader</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the classloader that will be used for scanning for classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getResources()">getResources</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the matching resources.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#setClassLoader(java.lang.ClassLoader)">setClassLoader</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</A>&nbsp;classloader)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets an explicit ClassLoader that should be used when scanning for classes.</TD>
</TR>
</TABLE>
&nbsp;<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.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/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/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= 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="ResolverUtil()"><!-- --></A><H3>
ResolverUtil</H3>
<PRE>
public <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.71"><B>ResolverUtil</B></A>()</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="getClasses()"><!-- --></A><H3>
getClasses</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html" title="type parameter in ResolverUtil">T</A>&gt;&gt; <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.93"><B>getClasses</B></A>()</PRE>
<DL>
<DD>Provides access to the classes discovered so far. If no calls have been made to
any of the <code>find()</code> methods, this set will be empty.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the set of classes that have been discovered.</DL>
</DD>
</DL>
<HR>
<A NAME="getResources()"><!-- --></A><H3>
getResources</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</A>&gt; <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.101"><B>getResources</B></A>()</PRE>
<DL>
<DD>Return the matching resources.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>A Set of URIs that match the criteria.</DL>
</DD>
</DL>
<HR>
<A NAME="getClassLoader()"><!-- --></A><H3>
getClassLoader</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</A> <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.112"><B>getClassLoader</B></A>()</PRE>
<DL>
<DD>Returns the classloader that will be used for scanning for classes. If no explicit
ClassLoader has been set by the calling, the context class loader will be used.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the ClassLoader that will be used to scan for classes</DL>
</DD>
</DL>
<HR>
<A NAME="setClassLoader(java.lang.ClassLoader)"><!-- --></A><H3>
setClassLoader</H3>
<PRE>
public void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.122"><B>setClassLoader</B></A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</A>&nbsp;classloader)</PRE>
<DL>
<DD>Sets an explicit ClassLoader that should be used when scanning for classes. If none
is set then the context classloader will be used.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>classloader</CODE> - a ClassLoader to use when scanning for classes</DL>
</DD>
</DL>
<HR>
<A NAME="findImplementations(java.lang.Class, java.lang.String...)"><!-- --></A><H3>
findImplementations</H3>
<PRE>
public void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.133"><B>findImplementations</B></A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;parent,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</PRE>
<DL>
<DD>Attempts to discover classes that are assignable to the type provided. In the case
that an interface is provided this method will collect implementations. In the case
of a non-interface class, subclasses will be collected. Accumulated classes can be
accessed by calling <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getClasses()"><CODE>getClasses()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>parent</CODE> - the class of interface to find subclasses or implementations of<DD><CODE>packageNames</CODE> - one or more package names to scan (including subpackages) for classes</DL>
</DD>
</DL>
<HR>
<A NAME="findSuffix(java.lang.String, java.lang.String...)"><!-- --></A><H3>
findSuffix</H3>
<PRE>
public void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.151"><B>findSuffix</B></A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;suffix,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</PRE>
<DL>
<DD>Attempts to discover classes who's name ends with the provided suffix. Accumulated classes can be
accessed by calling <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getClasses()"><CODE>getClasses()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>suffix</CODE> - The class name suffix to match<DD><CODE>packageNames</CODE> - one or more package names to scan (including subpackages) for classes</DL>
</DD>
</DL>
<HR>
<A NAME="findAnnotated(java.lang.Class, java.lang.String...)"><!-- --></A><H3>
findAnnotated</H3>
<PRE>
public void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.169"><B>findAnnotated</B></A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</A>&gt;&nbsp;annotation,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</PRE>
<DL>
<DD>Attempts to discover classes that are annotated with to the annotation. Accumulated
classes can be accessed by calling <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getClasses()"><CODE>getClasses()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>annotation</CODE> - the annotation that should be present on matching classes<DD><CODE>packageNames</CODE> - one or more package names to scan (including subpackages) for classes</DL>
</DD>
</DL>
<HR>
<A NAME="findNamedResource(java.lang.String, java.lang.String...)"><!-- --></A><H3>
findNamedResource</H3>
<PRE>
public void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.180"><B>findNamedResource</B></A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;pathNames)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="find(org.apache.logging.log4j.core.config.plugins.ResolverUtil.Test, java.lang.String...)"><!-- --></A><H3>
find</H3>
<PRE>
public void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.198"><B>find</B></A>(<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins">ResolverUtil.Test</A>&nbsp;test,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;packageNames)</PRE>
<DL>
<DD>Attempts to discover classes that pass the test. Accumulated
classes can be accessed by calling <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getClasses()"><CODE>getClasses()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>test</CODE> - the test to determine matching classes<DD><CODE>packageNames</CODE> - one or more package names to scan (including subpackages) for classes</DL>
</DD>
</DL>
<HR>
<A NAME="findInPackage(org.apache.logging.log4j.core.config.plugins.ResolverUtil.Test, java.lang.String)"><!-- --></A><H3>
findInPackage</H3>
<PRE>
public void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.218"><B>findInPackage</B></A>(<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins">ResolverUtil.Test</A>&nbsp;test,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;packageName)</PRE>
<DL>
<DD>Scans for classes starting at the package provided and descending into subpackages.
Each class is offered up to the Test as it is discovered, and if the Test returns
true the class is retained. Accumulated classes can be fetched by calling
<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#getClasses()"><CODE>getClasses()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>test</CODE> - an instance of <A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins"><CODE>ResolverUtil.Test</CODE></A> that will be used to filter classes<DD><CODE>packageName</CODE> - the name of the package from which to start scanning for
classes, e.g. <code>net.sourceforge.stripes</code></DL>
</DD>
</DL>
<HR>
<A NAME="addIfMatching(org.apache.logging.log4j.core.config.plugins.ResolverUtil.Test, java.lang.String)"><!-- --></A><H3>
addIfMatching</H3>
<PRE>
protected void <A HREF="../../../../../../../src-html/org/apache/logging/log4j/core/config/plugins/ResolverUtil.html#line.326"><B>addIfMatching</B></A>(<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.Test.html" title="interface in org.apache.logging.log4j.core.config.plugins">ResolverUtil.Test</A>&nbsp;test,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;fqn)</PRE>
<DL>
<DD>Add the class designated by the fully qualified class name provided to the set of
resolved classes if and only if it is approved by the Test supplied.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>test</CODE> - the test used to determine if the class matches<DD><CODE>fqn</CODE> - the fully qualified name of a class</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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ResolverUtil.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/PropertiesPlugin.html" title="class in org.apache.logging.log4j.core.config.plugins"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../../org/apache/logging/log4j/core/config/plugins/ResolverUtil.AnnotatedWith.html" title="class in org.apache.logging.log4j.core.config.plugins"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/logging/log4j/core/config/plugins/ResolverUtil.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ResolverUtil.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 1999-2012 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, and the Apache Logging project logo are trademarks of The Apache Software Foundation.
</BODY>
</HTML>