类 UObjectValue

java.lang.Object
com.gdxsoft.easyweb.utils.UObjectValue

public class UObjectValue extends Object
Reflect the class by name
  • 字段详细资料

  • 构造器详细资料

    • UObjectValue

      public UObjectValue()
  • 方法详细资料

    • setRequestValue

      public static boolean setRequestValue(Object instance, RequestValue rv)
      Set the target class setRequestValue
      参数:
      instance - The targetClass
      rv - the RequestValue
      返回:
      true: successful /false: fail
    • writeXmlNodeAtts

      public static void writeXmlNodeAtts(Element targetElement, Object source)
      Set the corresponding attributes of the target element through the get methods of the source class
      参数:
      targetElement - The target element
      source - the source class
    • writeXmlNodeTexts

      public static void writeXmlNodeTexts(Element targetElement, Object source)
      Create the corresponding child text nodes of the target element through the get methods of the source class
      参数:
      targetElement - The target element
      source - The source class
    • fromXml

      public static void fromXml(Node parentNode, Object targetClass)
      Set the corresponding parameters of the target class through the children text content of the source element
      参数:
      parentNode - the source node
      targetClass - the target class
    • fromXmlNodes

      public static void fromXmlNodes(Element parentElement, Object targetClass)
      Set the corresponding parameters of the target class through the children text content of the source element
      参数:
      parentElement - the source element
      targetClass - the target class
    • fromXml

      public static void fromXml(Element ele, Object targetClass)
      Set the corresponding parameters of the target class through the attributes of the source element
      参数:
      ele - the source element
      targetClass - the target class
    • setValue

      public static String setValue(Object instance, Method method, Object[] para)
      Set the target class parameter base on the method
      参数:
      instance - target class
      method - the method
      para - the set value
      返回:
      the result, when null is successful else is the error message
    • convert

      public static Object convert(Class<?> t, Object src)
      Convert to target object
      参数:
      t - the target object class
      src - the source object
      返回:
      the converted object
    • setAllValue

      public void setAllValue(Element ele)
      Set the corresponding parameters of the specified class through the attributes of the source element
      参数:
      ele - the source element
    • getAllValue

      public ArrayList<String[]> getAllValue()
      Get the specified class all get methods value,String, boolean, int...
      返回:
      the all get methods value
    • getValue

      public String getValue(Method method)
      Return the get method result
      参数:
      method - the get method
      返回:
      the return value
    • getValue

      public String getValue(String methodName)
      Get the value based on LIKE the get-method name
      参数:
      methodName - the get-method name
      返回:
      the get-method returns value
    • getValueAccurate

      public String getValueAccurate(String methodName)
      Get the value based on the get-method name
      参数:
      methodName - the get-method name
      返回:
      the get-method returns value
    • getProperty

      public Object getProperty(String methodName)
      Get the value based on the method name without "get/is"
      参数:
      methodName - the method name without "get/is"
      返回:
      the get method returns value
    • getPropertyMethod

      public Method getPropertyMethod(String methodName)
      获取属性对应的方法
      参数:
      methodName -
      返回:
    • setValue

      public String setValue(String methodName, String val)
      Set the specified class parameter base on LIKE the method name
      参数:
      methodName - the method name
      val - the set value
      返回:
      the result, when null is successful else is the error message
    • setValueAccurate

      public String setValueAccurate(String methodName, String val)
      Set the specified class parameter base on the method name
      参数:
      methodName - the method name
      val - the set value
      返回:
      the result, when null is successful else is the error message
    • getObject

      public Object getObject()
      返回:
      the specified class
    • setObject

      public void setObject(Object sourceClass)
      Set the source class as specified class
      参数:
      sourceClass - the source class
    • loadClass

      public boolean loadClass(String className, Object[] constructorParameters, String exeMethodName, Object[] methodValues)
      通过反射的方法调用类
      参数:
      className - 类名
      constructorParameters - 构造参数
      exeMethodName - 执行方法名
      methodValues - 执行参数
      返回:
      是否成功
    • loadClass

      public boolean loadClass(String className, Object[] constructorParameters, String exeMethodName, Object[] methodValues, RequestValue rv)
      通过反射的方法调用类
      参数:
      className - 类名
      constructorParameters - 构造参数
      exeMethodName - 执行方法名
      methodValues - 执行参数
      rv - 页面 RequestValue 对象
      返回:
      是否成功
    • loadClass

      public Object loadClass(String className, Object[] constructorParameters)
      通过反射加载类
      参数:
      className - 类名
      constructorParameters - 构造参数值
      返回:
      类实例
    • invokeStatic

      public Object invokeStatic(String className, String methodName, Object[] methodValues) throws Exception
      Invoke the static method
      参数:
      className - the class name
      methodName - the static method name
      methodValues - the method parameters
      返回:
      the result
      抛出:
      Exception - error
    • invoke

      public Object invoke(Object instance, String exeMethodName, Object[] methodValues)
      通过类实例执行方法
      参数:
      instance - 类实例
      exeMethodName - 执行方法名
      methodValues - 执行参数
      返回:
      执行后对象
    • invoke

      public Object invoke(Object instance, Method[] methods, String exeMethodName, Object[] methodValues)
      通过类实例执行方法
      参数:
      instance - 类实例
      methods - 方法数组
      exeMethodName - 执行方法名
      methodValues - 执行参数
      返回:
      执行后对象
    • setDaoValue

      public Object setDaoValue(ResultSet rs, String[] fieldList) throws Exception
      Set the specified class through the JDBC result and the specified field list
      参数:
      rs - the JDBC result
      fieldList - the specified field list
      返回:
      the specified class
      抛出:
      Exception - The exception
    • setDaoValue

      public Object setDaoValue(org.json.JSONObject json) throws Exception
      /** Set the specified class through the JSON object
      参数:
      json - the JSON object
      返回:
      the specified class
      抛出:
      Exception - The exception
    • setDaoValue

      public Object setDaoValue(org.json.JSONObject obj, IHandleJsonBinary handleJsonBinary) throws Exception
      Set the specified class through the JSON object
      参数:
      obj - the JSON object
      handleJsonBinary - The interface of the JSON binary
      返回:
      the specified class
      抛出:
      Exception - The exception
    • setDaoValue

      public Object setDaoValue(DTRow row) throws Exception
      Set the specified class through the DTRow
      参数:
      row - the DTRow
      返回:
      the specified class
      抛出:
      Exception - The exception
    • setDaoValue

      public Object setDaoValue(RequestValue rv) throws Exception
      Set the specified class through the RequestValue
      参数:
      rv - the RequestValue
      返回:
      the specified class
      抛出:
      Exception - The exception
    • getGetterMethods

      public ArrayList<Method> getGetterMethods()
      Returns all get methods
      返回:
      the _getterMethods
    • getInstance

      public Object getInstance()
      Get the loadClass instnace
      返回:
      the _Instance
    • getLastErrMsg

      public String getLastErrMsg()
      Get the last exception message
      返回:
      the _LastErrMsg
    • getNotFinds

      public List<KeyValuePair<String,Object>> getNotFinds()
      Get the not found methods of the setDaoValue
      返回:
      the _NotFinds