code: public void resolveBeanClass(TemplateRule templateRule) throws IllegalRuleException {
          String beanId = templateRule.getEngineBeanId();
          if (beanId != null) {
              Class<?> beanClass = resolveBeanClass(beanId, templateRule);
              if (beanClass != null) {
                  templateRule.setEngineBeanClass(beanClass);
                  reserveBeanReference(beanClass, templateRule);
              } else {
                  reserveBeanReference(beanId, templateRule);
              }
          } else {
              resolveBeanClass(templateRule.getTemplateTokens());
          }
      }
docs: Resolve bean class for the template rule.
  
  @param templateRule the template rule
  @throws IllegalRuleException if an illegal rule is found