@Override public final IClass getDeclaringClass() { return getMeta().getDeclaringClass(); }
errorSuffix.append(field.getDeclaringClass()).append(',');
errorSuffix.append(field.getDeclaringClass()).append(',');
@Override public void push(MethodExecuteContext context) { if (!IClassUtils.visible(context.getMethod().getDeclaringClass(), meta.getDirectOwnerType(), meta.getDeclaringClass(), meta.getModifiers())) { throw new IllegalArgumentException("Cannot access field " + meta.getDeclaringClass() + "#" + meta.getName() + " from " + context.getMethod().getDeclaringClass()); } if (LOG.isPrintEnabled()) { LOG.print("get field " + meta.getName() + " from class " + meta.getDirectOwnerType().getName() + " and push to stack!"); } context.getInstructions().getStatic(owner.getType(), meta.getName(), meta.getType().getType()); }
@Override public void push(MethodExecuteContext context) { if(!IClassUtils.visible(context.getMethod().getDeclaringClass(), meta.getDirectOwnerType(), meta.getDeclaringClass(), meta.getModifiers())){ throw new IllegalArgumentException("Cannot access field " + meta.getDeclaringClass() + "#" + meta.getName() + " from " + context.getMethod().getDeclaringClass()); } if(LOG.isPrintEnabled()){ LOG.print("Get field " + meta.getName() + " from variable " + meta.getName() + " and push to stack!"); } owner.push(context); context.getInstructions().getField(meta.getDirectOwnerType().getType(), meta.getName(), meta.getType().getType()); }
@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); } }