*/
public static synchronized AttributeExtractor getAttributeExtractor(final Class klass) {
if (klass.isPrimitive() || klass.isArray() || klass.getName().startsWith("java.")) {
return null;
}
BcelAttributeExtractor extractor;
if ((extractor = (BcelAttributeExtractor)s_extractorCache.get(klass)) == null) {
String className = klass.getName();
try {
ClassLoader loader = klass.getClassLoader();
if (loader != null) {
extractor = new BcelAttributeExtractor();
// extractor = new AsmAttributeExtractor();
extractor.initialize(className, klass.getClassLoader());
s_extractorCache.put(klass, extractor);
} else {
// bootstrap classloader
extractor = new BcelAttributeExtractor();
// extractor = new AsmAttributeExtractor();
extractor.initialize(className, ClassLoader.getSystemClassLoader());
s_extractorCache.put(klass, extractor);
}
} catch (Exception e) {
throw new WrappedRuntimeException(e);
}