Codota Logo
ReflectException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.lody.virtual.helper.utils.ReflectException
constructor

Best Java code snippets using com.lody.virtual.helper.utils.ReflectException.<init> (Showing top 20 results out of 315)

  • Common ways to obtain ReflectException
private void myMethod () {
ReflectException r =
  • Codota IconThrowable cause;new ReflectException(cause)
  • Codota IconObject object;Throwable cause;new ReflectException(object.getClass().getName(), cause)
  • Smart code suggestions by Codota
}
origin: android-hacker/VirtualXposed

/**
 * 取得一个类,此操作会初始化类的static区域.
 *
 * @see Class#forName(String)
 */
private static Class<?> forName(String name) throws ReflectException {
  try {
    return Class.forName(name);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

private static Class<?> forName(String name, ClassLoader classLoader) throws ReflectException {
  try {
    return Class.forName(name, true, classLoader);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

/**
 * 取得指定名称的字段
 *
 * @param name name
 * @return reflect
 * @throws ReflectException
 */
public Reflect field(String name) throws ReflectException {
  try {
    Field field = field0(name);
    return on(field.get(object));
  } catch (Exception e) {
    throw new ReflectException(object.getClass().getName(), e);
  }
}
origin: android-hacker/VirtualXposed

private static Reflect on(Constructor<?> constructor, Object... args) throws ReflectException {
  try {
    return on(accessible(constructor).newInstance(args));
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

private Field field0(String name) throws ReflectException {
  Class<?> type = type();
  // 先尝试取得公有字段
  try {
    return type.getField(name);
  }
  // 此时尝试非公有字段
  catch (NoSuchFieldException e) {
    do {
      try {
        return accessible(type.getDeclaredField(name));
      } catch (NoSuchFieldException ignore) {
      }
      type = type.getSuperclass();
    } while (type != null);
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

private static Reflect on(Method method, Object object, Object... args) throws ReflectException {
  try {
    accessible(method);
    if (method.getReturnType() == void.class) {
      method.invoke(object, args);
      return on(object);
    } else {
      return on(method.invoke(object, args));
    }
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

/**
 * 设置指定字段为指定值
 *
 * @param name
 * @param value
 * @return
 * @throws ReflectException
 */
public Reflect set(String name, Object value) throws ReflectException {
  try {
    Field field = field0(name);
    field.setAccessible(true);
    field.set(object, unwrap(value));
    return this;
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

throw new ReflectException("no method found for " + name, new NoSuchMethodException("No best method " + name + " with params " + Arrays.toString(types)
    + " could be found on type " + type() + "."));
origin: android-hacker/VirtualXposed

/**
 * 创建一个实例根据传入的参数
 *
 * @param args 参数
 * @return Reflect
 * @throws ReflectException
 */
public Reflect create(Object... args) throws ReflectException {
  Class<?>[] types = types(args);
  try {
    Constructor<?> constructor = type().getDeclaredConstructor(types);
    return on(constructor, args);
  } catch (NoSuchMethodException e) {
    for (Constructor<?> constructor : type().getDeclaredConstructors()) {
      if (match(constructor.getParameterTypes(), types)) {
        return on(constructor, args);
      }
    }
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

/**
 * 调用方法根据传入的参数
 *
 * @param name
 * @param args
 * @return
 * @throws ReflectException
 */
public Reflect call(String name, Object... args) throws ReflectException {
  Class<?>[] types = types(args);
  try {
    Method method = exactMethod(name, types);
    return on(method, object, args);
  } catch (NoSuchMethodException e) {
    try {
      Method method = similarMethod(name, types);
      return on(method, object, args);
    } catch (NoSuchMethodException e1) {
      throw new ReflectException(e1);
    }
  }
}
origin: bzsome/VirtualApp-x326

private static Class<?> forName(String name, ClassLoader classLoader) throws ReflectException {
  try {
    return Class.forName(name, true, classLoader);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: darkskygit/VirtualApp

private static Class<?> forName(String name, ClassLoader classLoader) throws ReflectException {
  try {
    return Class.forName(name, true, classLoader);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: darkskygit/VirtualApp

/**
 * 取得一个类,此操作会初始化类的static区域.
 *
 * @see Class#forName(String)
 */
private static Class<?> forName(String name) throws ReflectException {
  try {
    return Class.forName(name);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: bzsome/VirtualApp-x326

/**
 * 取得一个类,此操作会初始化类的static区域.
 *
 * @see Class#forName(String)
 */
private static Class<?> forName(String name) throws ReflectException {
  try {
    return Class.forName(name);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: darkskygit/VirtualApp

private static Reflect on(Constructor<?> constructor, Object... args) throws ReflectException {
  try {
    return on(accessible(constructor).newInstance(args));
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: bzsome/VirtualApp-x326

private static Reflect on(Constructor<?> constructor, Object... args) throws ReflectException {
  try {
    return on(accessible(constructor).newInstance(args));
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: darkskygit/VirtualApp

/**
 * 取得指定名称的字段
 *
 * @param name name
 * @return reflect
 * @throws ReflectException
 */
public Reflect field(String name) throws ReflectException {
  try {
    Field field = field0(name);
    return on(field.get(object));
  } catch (Exception e) {
    throw new ReflectException(object.getClass().getName(), e);
  }
}
origin: bzsome/VirtualApp-x326

/**
 * 取得指定名称的字段
 *
 * @param name name
 * @return reflect
 * @throws ReflectException
 */
public Reflect field(String name) throws ReflectException {
  try {
    Field field = field0(name);
    return on(field.get(object));
  } catch (Exception e) {
    throw new ReflectException(object.getClass().getName(), e);
  }
}
origin: darkskygit/VirtualApp

private static Reflect on(Method method, Object object, Object... args) throws ReflectException {
  try {
    accessible(method);
    if (method.getReturnType() == void.class) {
      method.invoke(object, args);
      return on(object);
    } else {
      return on(method.invoke(object, args));
    }
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: bzsome/VirtualApp-x326

private static Reflect on(Method method, Object object, Object... args) throws ReflectException {
  try {
    accessible(method);
    if (method.getReturnType() == void.class) {
      method.invoke(object, args);
      return on(object);
    } else {
      return on(method.invoke(object, args));
    }
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
com.lody.virtual.helper.utilsReflectException<init>

Popular methods of ReflectException

  • printStackTrace

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • startActivity (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now