Class BeanRepository


  • public class BeanRepository
    extends java.lang.Object
    Repository of {page, request, session, application}-scoped beans
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addBean​(Node.UseBean n, java.lang.String s, java.lang.String type, java.lang.String scope)
      Registers a scoped bean.
      boolean checkVariable​(java.lang.String bean)
      Checks if a bean with the given name is registered.
      java.lang.Class<?> getBeanType​(java.lang.String bean)
      Returns the class of a registered bean.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanRepository

        public BeanRepository​(java.lang.ClassLoader loader,
                              ErrorDispatcher err)
        Constructor.
        Parameters:
        loader - The class loader
        err - The error dispatcher that will be used to report errors
    • Method Detail

      • addBean

        public void addBean​(Node.UseBean n,
                            java.lang.String s,
                            java.lang.String type,
                            java.lang.String scope)
                     throws JasperException
        Registers a scoped bean.
        Parameters:
        n - the UseBean node
        s - the bean name
        type - the bean type
        scope - the bean scope
        Throws:
        JasperException - if the scope is invalid
      • getBeanType

        public java.lang.Class<?> getBeanType​(java.lang.String bean)
                                       throws JasperException
        Returns the class of a registered bean.
        Parameters:
        bean - the bean name
        Returns:
        the bean class
        Throws:
        JasperException - if the class cannot be loaded
      • checkVariable

        public boolean checkVariable​(java.lang.String bean)
        Checks if a bean with the given name is registered.
        Parameters:
        bean - the bean name
        Returns:
        true if the bean is registered