Class CommonsBeanUtilsPlugin

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

public class CommonsBeanUtilsPlugin extends Object implements org.sqlproc.engine.plugin.BeanUtilsPlugin
Bean utilities implementation based on Apache commons library.
Author:
Vladimir Hudec
  • Field Details

    • logger

      final org.slf4j.Logger logger
      The internal slf4j logger.
  • Constructor Details

    • CommonsBeanUtilsPlugin

      public CommonsBeanUtilsPlugin()
  • Method Details

    • getInstance

      public Object getInstance(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz)
      Specified by:
      getInstance in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • getAttributeDescriptor

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

      public Class<?> getAttributeType(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName)
      Specified by:
      getAttributeType in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • getAttributeParameterizedTypes

      public Class<?>[] getAttributeParameterizedTypes(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName)
      Specified by:
      getAttributeParameterizedTypes in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • getGetter

      protected Method getGetter(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName, boolean onlyCheck)
    • getGetterType

      public org.sqlproc.engine.plugin.BeanUtilsPlugin.GetterType getGetterType(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz, String attrName)
      Specified by:
      getGetterType in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • getGetterType

      public org.sqlproc.engine.plugin.BeanUtilsPlugin.GetterType getGetterType(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String attrName)
      Specified by:
      getGetterType in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • checkAttribute

      public boolean checkAttribute(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String attrName)
      Specified by:
      checkAttribute in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • getAttribute

      public Object getAttribute(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String attrName) throws org.sqlproc.engine.SqlRuntimeException
      Specified by:
      getAttribute in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
      Throws:
      org.sqlproc.engine.SqlRuntimeException
    • getSetter

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

      protected Method getSetter(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String attrName, Class<?>... attrTypes)
    • simpleSetAttribute

      public boolean simpleSetAttribute(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String attrName, Object attrValue, Class<?>... attrTypes)
      Specified by:
      simpleSetAttribute in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • setAttribute

      public void setAttribute(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String attrName, Object attrValue) throws org.sqlproc.engine.SqlRuntimeException
      Specified by:
      setAttribute in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
      Throws:
      org.sqlproc.engine.SqlRuntimeException
    • invokeMethod

      protected Object invokeMethod(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, Method method, Object... args) throws org.sqlproc.engine.SqlRuntimeException
      Throws:
      org.sqlproc.engine.SqlRuntimeException
    • checkMethod

      public boolean checkMethod(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz, String methodName, Class<?>... argTypes)
      Specified by:
      checkMethod in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • checkMethod

      public boolean checkMethod(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String methodName, Object... args)
      Specified by:
      checkMethod in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • invokeMethod

      public Object invokeMethod(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz, String methodName, Object... args) throws org.sqlproc.engine.SqlRuntimeException
      Specified by:
      invokeMethod in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
      Throws:
      org.sqlproc.engine.SqlRuntimeException
    • invokeMethod

      public Object invokeMethod(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean, String methodName, Object... args) throws org.sqlproc.engine.SqlRuntimeException
      Specified by:
      invokeMethod in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
      Throws:
      org.sqlproc.engine.SqlRuntimeException
    • invokeMethod

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

      public Object getEnumToValue(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Object bean)
      Specified by:
      getEnumToValue in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • getEnumToClass

      public Class<?> getEnumToClass(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz)
      Specified by:
      getEnumToClass in interface org.sqlproc.engine.plugin.BeanUtilsPlugin
    • getValueToEnum

      public Object getValueToEnum(org.sqlproc.engine.SqlRuntimeContext runtimeCtx, Class<?> clazz, Object val)
      Specified by:
      getValueToEnum in interface org.sqlproc.engine.plugin.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)