@Override public GlobalVariable field(String name) { if(value != null && value instanceof IClass) { try { Field field = ((IClass)value).getField(name); if(Modifiers.isStatic(field.getModifiers())) { return new StaticGlobalVariable((IClass)value, field); } else { throw new ASMSupportException("No such field " + name); } } catch (NoSuchFieldException e) { throw new ASMSupportException(e); } } return null; } }
@Override public GlobalVariable field(String name) { if(this.getResultType() instanceof ArrayClass){ throw new ASMSupportException("Cannot get global variable from array type variable : " + this); } try { Field field = getResultType().getField(name); if(Modifiers.isStatic(field.getModifiers())){ return new StaticGlobalVariable(field.getDeclaringClass(), field); } else { return new NonStaticGlobalVariable(this, field); } } catch (NoSuchFieldException e) { throw new ASMSupportException(e); } }
@Override public final GlobalVariable field(String name) { if(this.getResultType() instanceof ArrayClass){ throw new ASMSupportException("Cannot get global variable from array type variable : " + this); } try { Field field = getMeta().getType().getField(name); if(Modifiers.isStatic(field.getModifiers())){ return new StaticGlobalVariable(field.getDeclaringClass(), field); } else { return new NonStaticGlobalVariable(this, field); } } catch (NoSuchFieldException e) { throw new ASMSupportException(e); } }