Search in sources :

Example 1 with BindingVar

use of com.dtflys.forest.annotation.BindingVar in project forest by dromara.

the class ForestBeanProcessor method processBean.

private void processBean(Object bean, Class beanClass) {
    Method[] methods = beanClass.getDeclaredMethods();
    for (Method method : methods) {
        BindingVar annotation = method.getAnnotation(BindingVar.class);
        if (annotation == null) {
            continue;
        }
        String confId = annotation.configuration();
        ForestConfiguration configuration = null;
        if (StringUtils.isNotBlank(confId)) {
            configuration = Forest.config(confId);
        } else {
            configuration = Forest.config();
        }
        String varName = annotation.value();
        SpringVariableValue variableValue = new SpringVariableValue(bean, method);
        configuration.setVariableValue(varName, variableValue);
    }
}
Also used : ForestConfiguration(com.dtflys.forest.config.ForestConfiguration) Method(java.lang.reflect.Method) BindingVar(com.dtflys.forest.annotation.BindingVar)

Aggregations

BindingVar (com.dtflys.forest.annotation.BindingVar)1 ForestConfiguration (com.dtflys.forest.config.ForestConfiguration)1 Method (java.lang.reflect.Method)1