public Type getOutType(int index, Type type) { if (type.equals(Constants.TYPE_CLASS)) { return Constants.TYPE_STRING; } return type; } };
public Type getOutType(int index, Type type) { if (type.equals(Constants.TYPE_CLASS)) { return Constants.TYPE_STRING; } return type; } };
/** * Compare whether the parameter type is consistent * * @param types the type of the asm({@link Type}) * @param classes java type({@link Class}) * @return return param type equals */ private static boolean sameType(Type[] types, Class<?>[] classes) { if (types.length != classes.length) return false; for (int i = 0; i < types.length; i++) { if (!Type.getType(classes[i]).equals(types[i])) return false; } return true; }
/** * Compare whether the parameter type is consistent * * @param types the type of the asm({@link Type}) * @param classes java type({@link Class}) * @return return param type equals */ private static boolean sameType(Type[] types, Class<?>[] classes) { if (types.length != classes.length) return false; for (int i = 0; i < types.length; i++) { if (!Type.getType(classes[i]).equals(types[i])) return false; } return true; }
private static CallbackGenerator getGenerator(Type callbackType) { for (int i = 0; i < CALLBACKS.length; i++) { CallbackInfo info = CALLBACKS[i]; if (info.type.equals(callbackType)) { return info.generator; } } throw new IllegalStateException("Unknown callback type " + callbackType); } }
private static CallbackGenerator getGenerator(Type callbackType) { for (int i = 0; i < CALLBACKS.length; i++) { CallbackInfo info = CALLBACKS[i]; if (info.type.equals(callbackType)) { return info.generator; } } throw new IllegalStateException("Unknown callback type " + callbackType); } }
public void customize(CodeEmitter e, int index, Type type) { if (type.equals(Constants.TYPE_CLASS)) { e.invoke_virtual(Constants.TYPE_CLASS, GET_NAME); } }
public void customize(CodeEmitter e, Type type) { if (type.equals(Constants.TYPE_CLASS)) { e.invoke_virtual(Constants.TYPE_CLASS, GET_NAME); } } };
public void checkcast(Type type) { if (!type.equals(Constants.TYPE_OBJECT)) { emit_type(Constants.CHECKCAST, type); } }
public boolean customize(CodeEmitter e, Type type) { if (Constants.TYPE_TYPE.equals(type)) { e.invoke_virtual(type, GET_SORT); return true; } return false; } };
public void customize(CodeEmitter e, int index, Type type) { if (type.equals(Constants.TYPE_CLASS)) { e.invoke_virtual(Constants.TYPE_CLASS, GET_NAME); } }
public boolean customize(CodeEmitter e, Type type) { if (Constants.TYPE_TYPE.equals(type)) { e.invoke_virtual(type, GET_SORT); return true; } return false; } };
public void customize(CodeEmitter e, Type type) { if (type.equals(Constants.TYPE_CLASS)) { e.invoke_virtual(Constants.TYPE_CLASS, GET_NAME); } } };
public void checkcast(Type type) { if (!type.equals(Constants.TYPE_OBJECT)) { emit_type(Constants.CHECKCAST, type); } }
public static int getIdxByType(int access, String desc, Type type) { Type[] t = Type.getArgumentTypes(desc); int sidx = (AsmUtil.isStatic(access) ? 0 : 1); for (int i = 0; t != null && i < t.length; i++) { if (type.equals(t[i])) { return sidx; } sidx += t[i].getSize(); } return -1; }
public boolean equals(Object o) { if (o == null) return false; if (!(o instanceof ClassInfo)) return false; return getType().equals(((ClassInfo)o).getType()); }
public AddInitTransformer(Method method) { info = ReflectUtils.getMethodInfo(method); Type[] types = info.getSignature().getArgumentTypes(); if (types.length != 1 || !types[0].equals(Constants.TYPE_OBJECT) || !info.getSignature().getReturnType().equals(Type.VOID_TYPE)) { throw new IllegalArgumentException(method + " illegal signature"); } }
public boolean equals(Object o) { if (o == null) return false; if (!(o instanceof ClassInfo)) return false; return getType().equals(((ClassInfo)o).getType()); }
public AddStaticInitTransformer(Method classInit) { info = ReflectUtils.getMethodInfo(classInit); if (!TypeUtils.isStatic(info.getModifiers())) { throw new IllegalArgumentException(classInit + " is not static"); } Type[] types = info.getSignature().getArgumentTypes(); if (types.length != 1 || !types[0].equals(Constants.TYPE_CLASS) || !info.getSignature().getReturnType().equals(Type.VOID_TYPE)) { throw new IllegalArgumentException(classInit + " illegal signature"); } }
public AddStaticInitTransformer(Method classInit) { info = ReflectUtils.getMethodInfo(classInit); if (!TypeUtils.isStatic(info.getModifiers())) { throw new IllegalArgumentException(classInit + " is not static"); } Type[] types = info.getSignature().getArgumentTypes(); if (types.length != 1 || !types[0].equals(Constants.TYPE_CLASS) || !info.getSignature().getReturnType().equals(Type.VOID_TYPE)) { throw new IllegalArgumentException(classInit + " illegal signature"); } }