From 5ff797c94aec50e9f472f7e9d0c1fae080f54f8d Mon Sep 17 00:00:00 2001 From: Oliver Burn Date: Sat, 15 Jun 2002 13:01:08 +0000 Subject: [PATCH] Added support for specifying a class loader --- .../tools/checkstyle/Configuration.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java index 3db9ef723..bf48a9134 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Configuration.java @@ -103,6 +103,10 @@ public class Configuration /** line numbers to ignore in header **/ private TreeSet mHeaderIgnoreLineNo = new TreeSet(); + /** class loader to resolve classes with **/ + private ClassLoader mLoader = + Thread.currentThread().getContextClassLoader(); + /** where to place right curlies **/ private RightCurlyOption mRCurly = RightCurlyOption.SAME; @@ -144,8 +148,6 @@ public class Configuration mLCurliesProps.put(Defn.LCURLY_OTHER_PROP, LeftCurlyOption.EOL); } - - //////////////////////////////////////////////////////////////////////////// // Constructors //////////////////////////////////////////////////////////////////////////// @@ -295,6 +297,12 @@ public class Configuration // Getters //////////////////////////////////////////////////////////////////////////// + /** @return the class loader **/ + public ClassLoader getClassLoader() + { + return mLoader; + } + /** @return pattern to match todo lines **/ public String getTodoPat() { @@ -579,6 +587,15 @@ public class Configuration // Setters //////////////////////////////////////////////////////////////////////////// + /** + * Set the class loader for locating classes. + * @param aLoader the class loader + */ + public void setClassLoader(ClassLoader aLoader) + { + mLoader = aLoader; + } + /** * @param aPkgPrefixList comma separated list of package prefixes */