Пример #1
0
func _getGoField(fieldObj *heap.Object) *heap.Field {
	extra := fieldObj.Extra()
	if extra != nil {
		return extra.(*heap.Field)
	}

	root := fieldObj.GetFieldValue("root", "Ljava/lang/reflect/Field;").(*heap.Object)
	return root.Extra().(*heap.Field)
}
Пример #2
0
func _getGoMethod(methodObj *heap.Object, isConstructor bool) *heap.Method {
	extra := methodObj.Extra()
	if extra != nil {
		return extra.(*heap.Method)
	}

	if isConstructor {
		root := methodObj.GetFieldValue("root", "Ljava/lang/reflect/Constructor;").(*heap.Object)
		return root.Extra().(*heap.Method)
	} else {
		root := methodObj.GetFieldValue("root", "Ljava/lang/reflect/Method;").(*heap.Object)
		return root.Extra().(*heap.Method)
	}
}
Пример #3
0
func Unbox(obj *heap.Object, primitiveDescriptor string) interface{} {
	return obj.GetFieldValue("value", primitiveDescriptor)
}
Пример #4
0
func _getPath(fileObj *heap.Object) string {
	pathStr := fileObj.GetFieldValue("path", "Ljava/lang/String;").(*heap.Object)
	return rtda.GoString(pathStr)
}
Пример #5
0
// java.lang.String -> go string
func GoString(jStr *heap.Object) string {
	charArr := jStr.GetFieldValue("value", "[C").(*heap.Object)
	return _utf16ToString(charArr.Chars())
}