@Override public void edit(FieldAccess f) throws CannotCompileException { try { put(f.getField().getDeclaringClass().getName() + "." + f.getFieldName(), f.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + f.getFieldName() + " in " + key, e); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { try { put(f.getField().getDeclaringClass().getName() + "." + f.getFieldName(), f.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + f.getFieldName() + " in " + key, e); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { try { if ( ! f.isStatic() ) { CtClass type = null; type = f.getField().getType(); FSTClazzInfo.FSTFieldInfo fieldInfo = clInfo.getFieldInfo(f.getFieldName(), null); if ( fieldInfo == null ) { return; } if ( f.isReader() ) { structGen.defineStructReadAccess(f, type, fieldInfo); } else if ( f.isWriter() ) { structGen.defineStructWriteAccess(f, type, fieldInfo); } } } catch (Exception e) { e.printStackTrace(); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { try { if ( ! f.isStatic() ) { CtClass type = null; type = f.getField().getType(); FSTClazzInfo.FSTFieldInfo fieldInfo = clInfo.getFieldInfo(f.getFieldName(), null); if ( fieldInfo == null ) { return; } if ( f.isReader() ) { structGen.defineStructReadAccess(f, type, fieldInfo); } else if ( f.isWriter() ) { structGen.defineStructWriteAccess(f, type, fieldInfo); } } } catch (Exception e) { e.printStackTrace(); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { if ("lastPolledAge".equals(f.getFieldName())) { StringBuilder replacement = new StringBuilder(); replacement.append("$_ = creatureagemod.getAdjustedLastPolledAge(this, reborn);"); f.replace(replacement.toString()); } } });
public void edit(FieldAccess access) throws CannotCompileException { if (COLLECTIONS.equals(access.getClassName())) { if ("EMPTY_LIST".equals(access.getFieldName())) access.replace("$_ = " + COLLECTIONS + ".emptyList();"); else if ("EMPTY_SET".equals(access.getFieldName())) access.replace("$_ = " + COLLECTIONS + ".emptySet();"); else if ("EMPTY_MAP".equals(access.getFieldName())) access.replace("$_ = " + COLLECTIONS + ".emptyMap();"); } }
@Override public void edit(FieldAccess f) throws CannotCompileException { if (f.isWriter() && f.getClassName().equals("com.wurmonline.server.creatures.Communicator") && f.getFieldName().equals("commandMessage")) { StringBuffer code = new StringBuffer(); code.append("$proceed($$);\n"); code.append(String.format("if (%s#communicatorMessageHook(this, $1, title)) { return; };\n", ProxyServerHook.class.getName())); f.replace(code.toString()); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { if (f.getClassName().equals("com.wurmonline.server.creatures.CreatureTemplate") && f.getFieldName().equals("isHorse")) { f.replace("{ String name = org.gotti.wurmunlimited.modsupport.creatures.ModCreatures.getTraitName(this); if (name != null) { corpse.setDescription(name); $_ = false; } else { $_ = $proceed($$); } }"); } }
@Override public void edit(final FieldAccess access) throws CannotCompileException { if (access.getFieldName().equals(fieldName)) { access.replace(newCode); markEdited(); } } }.instrument(method);
@Override public void edit(final FieldAccess access) throws CannotCompileException { if (access.getFieldName().equals(fieldName)) { access.replace(newCode); markEdited(); } } }.instrument(method);
/** * Returns the field accessed by this expression. */ public CtField getField() throws NotFoundException { CtClass cc = getCtClass(); return cc.getField(getFieldName()); }
@Override public void edit(FieldAccess f) throws CannotCompileException { try { put(f.getField().getDeclaringClass().getName() + "." + f.getFieldName(), f.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + f.getFieldName() + " in " + key, e); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { try { put(f.getField().getDeclaringClass().getName() + "." + f.getFieldName(), f.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + f.getFieldName() + " in " + key, e); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { try { put(f.getField().getDeclaringClass().getName() + "." + f.getFieldName(), f.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + f.getFieldName() + " in " + key, e); } } });
@Override public void edit(FieldAccess f) throws CannotCompileException { try { put(f.getField().getDeclaringClass().getName() + "." + f.getFieldName() , f.getLineNumber() , key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + f.getFieldName() + " in " + key , e); } } });
/** * Returns the field accessed by this expression. */ public CtField getField() throws NotFoundException { CtClass cc = getCtClass(); return cc.getField(getFieldName()); }
/** * Returns the field accessed by this expression. */ public CtField getField() throws NotFoundException { CtClass cc = getCtClass(); return cc.getField(getFieldName()); }
/** * Returns the field accessed by this expression. */ public CtField getField() throws NotFoundException { CtClass cc = getCtClass(); return cc.getField(getFieldName()); }
/** * Returns the field accessed by this expression. */ public CtField getField() throws NotFoundException { CtClass cc = getCtClass(); return cc.getField(getFieldName()); }
public void edit(FieldAccess fieldAccess) throws CannotCompileException { if (!fieldAccess.getClassName().equals(clazz.getName())) return; if (!fieldAccess.getFieldName().equals(field.getName())) return; if (calledByInvocationClass(fieldAccess))return; if (fieldAccess.isReader() && doGet) { replaceRead(fieldAccess); } if (fieldAccess.isWriter() && doSet) { replaceWrite(fieldAccess); } }