/// <summary> /// Returns information for each field in a reference type. Inherited fields are not included. The field list will include any synthetic /// fields created by the compiler. Fields are returned in the order they occur in the class file. /// </summary> public Task <List <FieldInfo> > FieldsAsync(ReferenceTypeId id) { var conn = ConnectionOrError; var sizeInfo = conn.GetIdSizeInfo(); var t = conn.SendAsync(JdwpPacket.CreateCommand(conn, Nr, 14, sizeInfo.ReferenceTypeIdSize, x => id.WriteTo(x.Data))); return(t.ContinueWith(x => { x.ForwardException(); var result = x.Result; result.ThrowOnError(); var data = result.Data; var count = data.GetInt(); var list = new List <FieldInfo>(count); for (var i = 0; i < count; i++) { var fieldId = new FieldId(data); var name = data.GetString(); var signature = data.GetString(); var genericSignature = data.GetString(); var accessFlags = data.GetInt(); list.Add(new FieldInfo(fieldId, name, signature, genericSignature, accessFlags)); } return list; })); }
/// <summary> /// Default ctor /// </summary> public FieldOnlyModifier(ReferenceTypeId classId, FieldId fieldId) : base(9) { this.classId = classId; this.fieldId = fieldId; }