FileDocCategorySizeDatePackage
BeanRepository.javaAPI DocApache Tomcat 6.0.142324Fri Jul 20 04:20:32 BST 2007org.apache.jasper.compiler

BeanRepository

public class BeanRepository extends Object
Repository of {page, request, session, application}-scoped beans
author
Mandar Raje
author
Remy Maucherat

Fields Summary
protected HashMap
beanTypes
protected ClassLoader
loader
protected ErrorDispatcher
errDispatcher
Constructors Summary
public BeanRepository(ClassLoader loader, ErrorDispatcher err)
Constructor.

        this.loader = loader;
        this.errDispatcher = err;
        beanTypes = new HashMap<String, String>();
    
Methods Summary
public voidaddBean(Node.UseBean n, java.lang.String s, java.lang.String type, java.lang.String scope)


        if (!(scope == null || scope.equals("page") || scope.equals("request") 
                || scope.equals("session") || scope.equals("application"))) {
            errDispatcher.jspError(n, "jsp.error.usebean.badScope");
        }

        beanTypes.put(s, type);
    
public booleancheckVariable(java.lang.String bean)

        return beanTypes.containsKey(bean);
    
public java.lang.ClassgetBeanType(java.lang.String bean)

        Class clazz = null;
        try {
            clazz = loader.loadClass(beanTypes.get(bean));
        } catch (ClassNotFoundException ex) {
            throw new JasperException (ex);
        }
        return clazz;