Field reference instruction AST. @author Matt
| 10 | * @author Matt |
| 11 | */ |
| 12 | public class FieldInsnAST extends InsnAST { |
| 13 | private final TypeAST owner; |
| 14 | private final NameAST name; |
| 15 | private final DescAST desc; |
| 16 | |
| 17 | /** |
| 18 | * @param line |
| 19 | * Line number this node is written on. |
| 20 | * @param start |
| 21 | * Offset from line start this node starts at. |
| 22 | * @param opcode |
| 23 | * Opcode AST. |
| 24 | * @param owner |
| 25 | * Field owner type AST. |
| 26 | * @param name |
| 27 | * Field name AST. |
| 28 | * @param desc |
| 29 | * Field descriptor AST. |
| 30 | */ |
| 31 | public FieldInsnAST(int line, int start, OpcodeAST opcode, TypeAST owner, NameAST name, DescAST desc) { |
| 32 | super(line, start, opcode); |
| 33 | this.owner = owner; |
| 34 | this.name = name; |
| 35 | this.desc = desc; |
| 36 | addChild(owner); |
| 37 | addChild(name); |
| 38 | addChild(desc); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * @return Type AST of field owner. |
| 43 | */ |
| 44 | public TypeAST getOwner() { |
| 45 | return owner; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * @return Name AST of field name. |
| 50 | */ |
| 51 | public NameAST getName() { |
| 52 | return name; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * @return Desc AST of field descriptor. |
| 57 | */ |
| 58 | public DescAST getDesc() { |
| 59 | return desc; |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public String print() { |
| 64 | return getOpcode().print() + " " + owner.print() + "." + name.print() + " " + desc.print(); |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public void compile(MethodCompilation compilation) throws AssemblerException { |
| 69 | compilation.addInstruction(new FieldInsnNode(getOpcode().getOpcode(), getOwner().getType(), |
nothing calls this directly
no outgoing calls
no test coverage detected