void read(Instruction orig) { super.read(orig); FieldInstruction ins = (FieldInstruction) orig; setField(ins.getFieldDeclarerName(), ins.getFieldName(), ins.getFieldTypeName()); }
public BCField run() { return instruction.getField(); } };
/** * Return the field this instruction operates on, or null if not set. */ public BCField getField() { String dec = getFieldDeclarerName(); if (dec == null) return null; BCClass bc = getProject().loadClass(dec, getClassLoader()); BCField[] fields = bc.getFields(getFieldName()); if (fields.length == 0) return null; return fields[0]; }
/** * Set the name of the field this instruction operates on. * * @return this instruction, for method chaining */ public FieldInstruction setFieldName(String name) { return setField(getFieldDeclarerName(), name, getFieldTypeName()); }
/** * Set the declaring class of the field this instruction operates on. * * @return this instruction, for method chaining */ public FieldInstruction setFieldDeclarer(String type) { return setField(type, getFieldName(), getFieldTypeName()); }
/** * Set the type of the field this instruction operates on. * * @return this instruction, for method chaining */ public FieldInstruction setFieldType(String type) { return setField(getFieldDeclarerName(), getFieldName(), type); }
name = fi.getFieldName(); typeName = fi.getFieldTypeName(); owner = getPersistenceCapableOwner(name, fi.getFieldDeclarerType()); .getFieldInstructionFieldAction(fFi))); int val = code.getNextLocalsIndex(); code.xstore().setLocal(val).setType(fi.getFieldType());
/** * FieldInstructions are equal if the field they reference is the same, * or if the field of either is unset. */ public boolean equalsInstruction(Instruction other) { if (other == this) return true; if (!(other instanceof FieldInstruction)) return false; if (!super.equalsInstruction(other)) return false; FieldInstruction ins = (FieldInstruction) other; String s1 = getFieldName(); String s2 = ins.getFieldName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false; s1 = getFieldTypeName(); s2 = ins.getFieldTypeName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false; s1 = getFieldDeclarerName(); s2 = ins.getFieldDeclarerName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false; return true; }
/** * Return the type of the field this instruction operates on, or null * if not set. */ public BCClass getFieldTypeBC() { String type = getFieldTypeName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Return the type of the field this instruction operates on, or null * if not set. */ public String getFieldTypeName() { int index = getFieldIndex(); if (index == 0) return null; ComplexEntry entry = (ComplexEntry) getPool().getEntry(index); String name = getProject().getNameCache().getExternalForm(entry. getNameAndTypeEntry().getDescriptorEntry().getValue(), false); if (name.length() == 0) return null; return name; }
/** * Return the type of the field this instruction operates on, or null * if not set. */ public Class getFieldType() { String type = getFieldTypeName(); if (type == null) return null; return Strings.toClass(type, getClassLoader()); }
/** * Set the field this instruction operates on, for fields that are * declared by the current class. * * @param name the field name * @param type the class of the field type * @return this instruction, for method chaining */ public FieldInstruction setField(String name, Class type) { BCClass owner = getCode().getMethod().getDeclarer(); String typeName = (type == null) ? null : type.getName(); return setField(owner.getName(), name, typeName); }
/** * Return the declaring class of the field this instruction operates on, * or null if not set. */ public BCClass getFieldDeclarerBC() { String type = getFieldDeclarerName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Return the name of the field this instruction operates on, or null * if not set. */ public String getFieldName() { int index = getFieldIndex(); if (index == 0) return null; ComplexEntry entry = (ComplexEntry) getPool().getEntry(index); String name = entry.getNameAndTypeEntry().getNameEntry().getValue(); if (name.length() == 0) return null; return name; }
/** * Return the declaring class of the field this instruction operates on, * or null if not set. */ public Class getFieldDeclarerType() { String type = getFieldDeclarerName(); if (type == null) return null; return Strings.toClass(type, getClassLoader()); }
void write(DataOutput out) throws IOException { super.write(out); out.writeShort(getFieldIndex()); } }
name = fi.getFieldName(); typeName = fi.getFieldTypeName(); owner = getPersistenceCapableOwner(name, fi.getFieldDeclarerType()); FieldMetaData fmd = owner == null ? null : owner.getField(name); if (isPropertyAccess(fmd)) { .getFieldInstructionFieldAction(fFi))); int val = code.getNextLocalsIndex(); code.xstore().setLocal(val).setType(fi.getFieldType());
/** * Set the declaring class of the field this instruction operates on. * * @return this instruction, for method chaining */ public FieldInstruction setFieldDeclarer(String type) { return setField(type, getFieldName(), getFieldTypeName()); }
/** * FieldInstructions are equal if the field they reference is the same, * or if the field of either is unset. */ public boolean equalsInstruction(Instruction other) { if (other == this) return true; if (!(other instanceof FieldInstruction)) return false; if (!super.equalsInstruction(other)) return false; FieldInstruction ins = (FieldInstruction) other; String s1 = getFieldName(); String s2 = ins.getFieldName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false; s1 = getFieldTypeName(); s2 = ins.getFieldTypeName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false; s1 = getFieldDeclarerName(); s2 = ins.getFieldDeclarerName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false; return true; }
/** * Set the name of the field this instruction operates on. * * @return this instruction, for method chaining */ public FieldInstruction setFieldName(String name) { return setField(getFieldDeclarerName(), name, getFieldTypeName()); }