001    package org.mesopotamia.lang.java.ref.bcel;
002    
003    import org.apache.bcel.util.ClassLoaderRepository;
004    import org.mesopotamia.lang.java.ref.Scope;
005    import org.mesopotamia.lang.java.ref.TypeInfo;
006    
007    public class JavaClassTypeInfoRepository {
008            
009            private ClassLoaderRepository repository;
010    
011            public JavaClassTypeInfoRepository(ClassLoader classLoader) {
012                    this.repository = new ClassLoaderRepository(classLoader);
013            }
014            
015            /**
016             * 
017             * @param name
018             * @param scope
019             * @return type info or null if type info is not found. 
020             */
021            public TypeInfo getTypeInfo(String fcn, Scope scope) {
022                    try {
023                            return new JavaClassTypeInfo(repository.loadClass(fcn), scope, this);
024                    } catch (ClassNotFoundException e) {
025                            return null;
026                    }
027            }
028            
029            public ClassLoaderRepository getRepository() {
030                    return repository;
031            }
032    
033    }