code: public BeanMap getBeanMap(Object bean, boolean failOnNulls) 
          throws BeanContextException {
          
          BeanPropertyAccessor accessor = 
              BeanPropertyAccessor.forClass(bean.getClass());
          return new BeanMap(bean, accessor, failOnNulls);
      }
docs: Get an object wrapping the given bean that allows dynamic property
  lookups.  The <code>failOnNulls</code> parameter may be used to cause
  an exception to be thrown when portions of the composite graph are
  <code>null</code>.
  
  <code>bean = getBeanMap(bean); bean['name']</code>
  
  @param bean The bean to wrap and return
  @param failOnNulls The state of whether to throw exceptions on null graph
  
  @return The object allowing dynamic lookups on the bean
  
  @throws BeanContextException If any portion of the composite graph is
  <code>null</code> such as city being null in 'team.city.name'.
  This is only thrown if failOnNulls is <code>true</code>