Example usage for org.springframework.beans.factory NamedBean getClass

List of usage examples for org.springframework.beans.factory NamedBean getClass

Introduction

In this page you can find the example usage for org.springframework.beans.factory NamedBean getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.opensingular.form.spring.SpringFormUtil.java

/**
 * Verificar se o nome do bean foi configurado. Ou seja, se o bean foi
 * carregado via Spring.// w  w  w.  j a  va 2  s . c o m
 */
public static String checkBeanName(NamedBean bean) {
    if (StringUtils.isBlank(bean.getBeanName())) {
        throw new SingularFormException("O nome do bean no spring no foi configurado para a classe "
                + bean.getClass().getName()
                + ". Verifique se o bean foi corretamente registrado no Spring antes de ser utilizado.");
    }
    return bean.getBeanName();
}

From source file:org.opensingular.form.spring.SpringFormUtil.java

public static String erroMsg(NamedBean bean, String msg) {
    StringBuilder sb = new StringBuilder();
    sb.append('[');
    if (bean.getBeanName() != null) {
        sb.append("bean=").append(bean.getBeanName()).append("; ");
    }/*from w w  w.jav a2 s . c  o  m*/
    sb.append("class=").append(bean.getClass()).append("]: ").append(msg);
    return sb.toString();
}