-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjmethod.go
35 lines (32 loc) · 897 Bytes
/
jmethod.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package gytes
import "fmt"
// Java method representation
//
// method_info {
// u2 access_flags;
// u2 name_index;
// u2 descriptor_index;
// u2 attributes_count;
// attribute_info attributes[attributes_count];
// }
type JavaMethod struct {
Name string
Modifiers uint16
Descriptor string
MaxStack uint16
MaxLocals uint16
Exceptions []string
// The offset in the original class file at which the code of this class starts
// This is computed at class read time by finding the Code attribute in the method's attribute list.
BodyOffset int
Body []BytesBlock
}
func (jm JavaMethod) String() string {
return fmt.Sprintf("Modifiers=%d Name=%s Descriptor=%s MaxStack=%d MaxLocals=%d BytesBlock=%v Exceptions=%v", jm.Modifiers,
jm.Name,
jm.Descriptor,
jm.MaxStack,
jm.MaxLocals,
jm.Body,
jm.Exceptions)
}