org.sqlproc.engine.plugin
Class CommonsBeanUtilsPlugin

java.lang.Object
  extended by org.sqlproc.engine.plugin.CommonsBeanUtilsPlugin
All Implemented Interfaces:
BeanUtilsPlugin

public class CommonsBeanUtilsPlugin
extends Object
implements BeanUtilsPlugin

Bean utilities implementation based on Apache commons library.

Author:
Vladimir Hudec

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sqlproc.engine.plugin.BeanUtilsPlugin
BeanUtilsPlugin.GetterType
 
Field Summary
(package private)  org.slf4j.Logger logger
          The internal slf4j logger.
 
Constructor Summary
CommonsBeanUtilsPlugin()
           
 
Method Summary
protected  String attrTypes2String(Class<?>... attrTypes)
           
 boolean checkAttribute(SqlRuntimeContext runtimeCtx, Object bean, String attrName)
          
 boolean checkMethod(SqlRuntimeContext runtimeCtx, Class<?> clazz, String methodName, Class<?>... argTypes)
          
 boolean checkMethod(SqlRuntimeContext runtimeCtx, Object bean, String methodName, Object... args)
          
protected  String debugInfo(String msg, Object bean, Method method, Object... args)
           
protected  String debugInfo(String msg, Object bean, String methodName, Method method, Object... args)
           
 Object getAttribute(SqlRuntimeContext runtimeCtx, Object bean, String attrName)
          
protected  PropertyDescriptor getAttributeDescriptor(Class<?> clazz, String attrName)
           
 Class<?> getAttributeType(SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName)
          
 Class<?> getEnumToClass(SqlRuntimeContext runtimeCtx, Class<?> clazz)
           
 Object getEnumToValue(SqlRuntimeContext runtimeCtx, Object bean)
           
protected  Method getGetter(SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName, boolean onlyCheck)
           
 BeanUtilsPlugin.GetterType getGetterType(SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName)
          
 BeanUtilsPlugin.GetterType getGetterType(SqlRuntimeContext runtimeCtx, Object bean, String attrName)
          
 Object getInstance(SqlRuntimeContext runtimeCtx, Class<?> clazz)
          
protected  Method getSetter(SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName, boolean onlyCheck, Class<?>... attrTypes)
           
protected  Method getSetter(SqlRuntimeContext runtimeCtx, Object bean, String attrName, Class<?>... attrTypes)
           
 Object getValueToEnum(SqlRuntimeContext runtimeCtx, Class<?> clazz, Object val)
           
protected  Object invokeMethod(SqlRuntimeContext runtimeCtx, Class<?> clazz, Object bean, String methodName, Object... args)
           
 Object invokeMethod(SqlRuntimeContext runtimeCtx, Class<?> clazz, String methodName, Object... args)
          
protected  Object invokeMethod(SqlRuntimeContext runtimeCtx, Object bean, Method method, Object... args)
           
 Object invokeMethod(SqlRuntimeContext runtimeCtx, Object bean, String methodName, Object... args)
          
 void setAttribute(SqlRuntimeContext runtimeCtx, Object bean, String attrName, Object attrValue)
          
 boolean simpleSetAttribute(SqlRuntimeContext runtimeCtx, Object bean, String attrName, Object attrValue, Class<?>... attrTypes)
          
protected  Object[] toArray(Object arg)
           
protected  Class<?>[] toParameterTypes(Object arg)
           
protected  Class<?>[] toParameterTypes(Object[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

final org.slf4j.Logger logger
The internal slf4j logger.

Constructor Detail

CommonsBeanUtilsPlugin

public CommonsBeanUtilsPlugin()
Method Detail

getInstance

public Object getInstance(SqlRuntimeContext runtimeCtx,
                          Class<?> clazz)

Specified by:
getInstance in interface BeanUtilsPlugin

getAttributeDescriptor

protected PropertyDescriptor getAttributeDescriptor(Class<?> clazz,
                                                    String attrName)

getAttributeType

public Class<?> getAttributeType(SqlRuntimeContext runtimeCtx,
                                 Class<?> clazz,
                                 String attrName)

Specified by:
getAttributeType in interface BeanUtilsPlugin

getGetter

protected Method getGetter(SqlRuntimeContext runtimeCtx,
                           Class<?> clazz,
                           String attrName,
                           boolean onlyCheck)

getGetterType

public BeanUtilsPlugin.GetterType getGetterType(SqlRuntimeContext runtimeCtx,
                                                Class<?> clazz,
                                                String attrName)

Specified by:
getGetterType in interface BeanUtilsPlugin

getGetterType

public BeanUtilsPlugin.GetterType getGetterType(SqlRuntimeContext runtimeCtx,
                                                Object bean,
                                                String attrName)

Specified by:
getGetterType in interface BeanUtilsPlugin

checkAttribute

public boolean checkAttribute(SqlRuntimeContext runtimeCtx,
                              Object bean,
                              String attrName)

Specified by:
checkAttribute in interface BeanUtilsPlugin

getAttribute

public Object getAttribute(SqlRuntimeContext runtimeCtx,
                           Object bean,
                           String attrName)
                    throws SqlRuntimeException

Specified by:
getAttribute in interface BeanUtilsPlugin
Throws:
SqlRuntimeException

getSetter

protected Method getSetter(SqlRuntimeContext runtimeCtx,
                           Class<?> clazz,
                           String attrName,
                           boolean onlyCheck,
                           Class<?>... attrTypes)

getSetter

protected Method getSetter(SqlRuntimeContext runtimeCtx,
                           Object bean,
                           String attrName,
                           Class<?>... attrTypes)

simpleSetAttribute

public boolean simpleSetAttribute(SqlRuntimeContext runtimeCtx,
                                  Object bean,
                                  String attrName,
                                  Object attrValue,
                                  Class<?>... attrTypes)

Specified by:
simpleSetAttribute in interface BeanUtilsPlugin

setAttribute

public void setAttribute(SqlRuntimeContext runtimeCtx,
                         Object bean,
                         String attrName,
                         Object attrValue)
                  throws SqlRuntimeException

Specified by:
setAttribute in interface BeanUtilsPlugin
Throws:
SqlRuntimeException

invokeMethod

protected Object invokeMethod(SqlRuntimeContext runtimeCtx,
                              Object bean,
                              Method method,
                              Object... args)
                       throws SqlRuntimeException
Throws:
SqlRuntimeException

checkMethod

public boolean checkMethod(SqlRuntimeContext runtimeCtx,
                           Class<?> clazz,
                           String methodName,
                           Class<?>... argTypes)

Specified by:
checkMethod in interface BeanUtilsPlugin

checkMethod

public boolean checkMethod(SqlRuntimeContext runtimeCtx,
                           Object bean,
                           String methodName,
                           Object... args)

Specified by:
checkMethod in interface BeanUtilsPlugin

invokeMethod

public Object invokeMethod(SqlRuntimeContext runtimeCtx,
                           Class<?> clazz,
                           String methodName,
                           Object... args)
                    throws SqlRuntimeException

Specified by:
invokeMethod in interface BeanUtilsPlugin
Throws:
SqlRuntimeException

invokeMethod

public Object invokeMethod(SqlRuntimeContext runtimeCtx,
                           Object bean,
                           String methodName,
                           Object... args)
                    throws SqlRuntimeException

Specified by:
invokeMethod in interface BeanUtilsPlugin
Throws:
SqlRuntimeException

invokeMethod

protected Object invokeMethod(SqlRuntimeContext runtimeCtx,
                              Class<?> clazz,
                              Object bean,
                              String methodName,
                              Object... args)
                       throws SqlRuntimeException
Throws:
SqlRuntimeException

getEnumToValue

public Object getEnumToValue(SqlRuntimeContext runtimeCtx,
                             Object bean)
Specified by:
getEnumToValue in interface BeanUtilsPlugin

getEnumToClass

public Class<?> getEnumToClass(SqlRuntimeContext runtimeCtx,
                               Class<?> clazz)
Specified by:
getEnumToClass in interface BeanUtilsPlugin

getValueToEnum

public Object getValueToEnum(SqlRuntimeContext runtimeCtx,
                             Class<?> clazz,
                             Object val)
Specified by:
getValueToEnum in interface BeanUtilsPlugin

attrTypes2String

protected String attrTypes2String(Class<?>... attrTypes)

toArray

protected Object[] toArray(Object arg)

toParameterTypes

protected Class<?>[] toParameterTypes(Object arg)

toParameterTypes

protected Class<?>[] toParameterTypes(Object[] args)

debugInfo

protected String debugInfo(String msg,
                           Object bean,
                           Method method,
                           Object... args)

debugInfo

protected String debugInfo(String msg,
                           Object bean,
                           String methodName,
                           Method method,
                           Object... args)


Copyright © 2015. All rights reserved.