private void processFields(CtClass clazz) throws CannotCompileException, NotFoundException { CtField[] fs = clazz.getDeclaredFields(); for (int i = 0; i < fs.length; ++i) { CtField f = fs[i]; int mod = f.getModifiers(); if ((mod & Modifier.PUBLIC) != 0 && (mod & Modifier.FINAL) == 0) { mod |= Modifier.STATIC; String name = f.getName(); CtClass ftype = f.getType(); CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); CtClass[] writeParam = new CtClass[2]; writeParam[0] = classPool.get("java.lang.Object"); writeParam[1] = ftype; wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); } } }
= CtNewMethod.wrapped(toCtClass(m.getReturnType()), m.getName(), toCtClass(m.getParameterTypes()),
private void processFields(CtClass clazz) throws CannotCompileException, NotFoundException { CtField[] fs = clazz.getDeclaredFields(); for (int i = 0; i < fs.length; ++i) { CtField f = fs[i]; int mod = f.getModifiers(); if ((mod & Modifier.PUBLIC) != 0 && (mod & Modifier.FINAL) == 0) { mod |= Modifier.STATIC; String name = f.getName(); CtClass ftype = f.getType(); CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); CtClass[] writeParam = new CtClass[2]; writeParam[0] = classPool.get("java.lang.Object"); writeParam[1] = ftype; wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); } } }
= CtNewMethod.wrapped(toCtClass(m.getReturnType()), m.getName(), toCtClass(m.getParameterTypes()),
= CtNewMethod.wrapped(m.getReturnType(), name, m.getParameterTypes(), m.getExceptionTypes(), body, ConstParameter.integer(identifier),
= CtNewMethod.wrapped(m.getReturnType(), name, m.getParameterTypes(), m.getExceptionTypes(), body, ConstParameter.integer(identifier),
private void processFields(CtClass clazz) throws CannotCompileException, NotFoundException { CtField[] fs = clazz.getDeclaredFields(); for (int i = 0; i < fs.length; ++i) { CtField f = fs[i]; int mod = f.getModifiers(); if ((mod & Modifier.PUBLIC) != 0 && (mod & Modifier.FINAL) == 0) { mod |= Modifier.STATIC; String name = f.getName(); CtClass ftype = f.getType(); CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); CtClass[] writeParam = new CtClass[2]; writeParam[0] = classPool.get("java.lang.Object"); writeParam[1] = ftype; wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); } } }
private void processFields(CtClass clazz) throws CannotCompileException, NotFoundException { CtField[] fs = clazz.getDeclaredFields(); for (int i = 0; i < fs.length; ++i) { CtField f = fs[i]; int mod = f.getModifiers(); if ((mod & Modifier.PUBLIC) != 0 && (mod & Modifier.FINAL) == 0) { mod |= Modifier.STATIC; String name = f.getName(); CtClass ftype = f.getType(); CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); CtClass[] writeParam = new CtClass[2]; writeParam[0] = classPool.get("java.lang.Object"); writeParam[1] = ftype; wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); } } }
CtClass ftype = f.getType(); CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), writeParam[0] = classPool.get("java.lang.Object"); writeParam[1] = ftype; wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite,
private void processFields(CtClass clazz) throws CannotCompileException, NotFoundException { CtField[] fs = clazz.getDeclaredFields(); for (int i = 0; i < fs.length; ++i) { CtField f = fs[i]; int mod = f.getModifiers(); if ((mod & Modifier.PUBLIC) != 0 && (mod & Modifier.FINAL) == 0) { mod |= Modifier.STATIC; String name = f.getName(); CtClass ftype = f.getType(); CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); CtClass[] writeParam = new CtClass[2]; writeParam[0] = classPool.get("java.lang.Object"); writeParam[1] = ftype; wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite, ConstParameter.string(name), clazz); wmethod.setModifiers(mod); clazz.addMethod(wmethod); } } }
CtClass ftype = f.getType(); CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), writeParam[0] = classPool.get("java.lang.Object"); writeParam[1] = ftype; wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite,
= CtNewMethod.wrapped(toCtClass(m.getReturnType()), m.getName(), toCtClass(m.getParameterTypes()),
protected CtMethod addMixinMethod(Advisor advisor, CtMethod method, CtClass clazz, CtMethod delegate, long hash) throws Exception { CtClass[] exceptions = method.getExceptionTypes(); // create base, delegating method. CtMethod newMethod = CtNewMethod.wrapped(method.getReturnType(), method.getName(), method.getParameterTypes(), exceptions, delegate, CtMethod.ConstParameter.integer(hash), clazz); newMethod.setModifiers(Modifier.PUBLIC); clazz.addMethod(newMethod); return newMethod; }
= CtNewMethod.wrapped(toCtClass(m.getReturnType()), m.getName(), toCtClass(m.getParameterTypes()),
= CtNewMethod.wrapped(toCtClass(m.getReturnType()), m.getName(), toCtClass(m.getParameterTypes()),
= CtNewMethod.wrapped(toCtClass(m.getReturnType()), m.getName(), toCtClass(m.getParameterTypes()),
= CtNewMethod.wrapped(toCtClass(m.getReturnType()), m.getName(), toCtClass(m.getParameterTypes()),
= CtNewMethod.wrapped(m.getReturnType(), name, m.getParameterTypes(), m.getExceptionTypes(), body, ConstParameter.integer(identifier),
= CtNewMethod.wrapped(m.getReturnType(), name, m.getParameterTypes(), m.getExceptionTypes(), body, ConstParameter.integer(identifier),
= CtNewMethod.wrapped(m.getReturnType(), name, m.getParameterTypes(), m.getExceptionTypes(), body, ConstParameter.integer(identifier),