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