@Override public IClass getResultType() { return field.getType(); }
@Override public IClass getResultType() { return meta.getType(); }
private VariableOperatorException() { super("the scope cannot use the variable \"" + meta.getName() + "\""); } }
@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); } }
public ThisVariable(IClass clazz) { this.globalVariableMeta = new Field(clazz, clazz, clazz, Opcodes.ACC_FINAL, ASConstants.THIS); }
@Override public void doExecute(MethodExecuteContext context) { if(LOG.isPrintEnabled()){ LOG.print("assign value to global variable '" + var.getMeta().getName() + "' from " + value ); } value.push(context); autoCast(context); context.getInstructions().putStatic(var.getOwner().getType(), var.getMeta().getName(), var.getMeta().getType().getType()); }
@Override public final IClass getDeclaringClass() { return getMeta().getDeclaringClass(); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((declaringClass == null) ? 0 : declaringClass.hashCode()); result = prime * result + ((directOwnerType == null) ? 0 : directOwnerType.hashCode()); return result; }
@Override public final int getModifiers() { return getMeta().getModifiers(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } Field other = (Field) obj; if (declaringClass == null) { if (other.declaringClass != null) { return false; } } else if (!declaringClass.equals(other.declaringClass)) { return false; } if (directOwnerType == null) { if (other.directOwnerType != null) { return false; } } else if (!directOwnerType.equals(other.directOwnerType)) { return false; } return true; }
@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 protected boolean process(Class<?> inter) { try { java.lang.reflect.Field f = inter.getDeclaredField(name); found.add(new Field(ProductClass.this, classLoader.getType(inter), classLoader.getType(f.getType()), f.getModifiers(), name)); return true; } catch (NoSuchFieldException e) { return false; } } }.loop(reallyClass.getInterfaces());
@Override public IClass getResultType() { return meta.getType(); }
@Override public void push(MethodExecuteContext context) { context.getInstructions().loadInsn(meta.getType().getType(), scopeLogicVar.getInitStartPos()); }
@Override public final String getName() { return getMeta().getName(); }
@Override public void initialized(ClassExecuteContext context) { MutableClass owner = (MutableClass) context.getOwner(); owner.addField(fe = new Field(owner, owner, type, modifiers, name)); }
@Override public IClass getResultType() { return globalVariableMeta.getType(); }
/** * Generates the instruction to store the top stack value in a local * variable. * * @param var */ public void storeInsn(final LocalVariable var) { locals.setCursor(var.getScopeLogicVar()); locals.printState(); mv.visitVarInsn(var.getMeta().getType().getType().getOpcode(Opcodes.ISTORE), var.getScopeLogicVar().getInitStartPos()); }
public SuperVariable(IClass clazz) { this.field = new Field( clazz.getSuperclass(), clazz.getSuperclass(), clazz.getSuperclass(), Opcodes.ACC_FINAL, ASConstants.SUPER); }
@Override public IClass getResultType() { return meta.getType(); }