示例#1
0
func _getGoField(fieldObj *rtc.Obj) *rtc.Field {
	extra := fieldObj.Extra()
	if extra != nil {
		return extra.(*rtc.Field)
	}

	root := fieldObj.GetFieldValue("root", "Ljava/lang/reflect/Field;").(*rtc.Obj)
	return root.Extra().(*rtc.Field)
}
示例#2
0
文件: helper.go 项目: cretz/jvm.go
func _getGoMethod(methodObj *rtc.Obj, isConstructor bool) *rtc.Method {
	extra := methodObj.Extra()
	if extra != nil {
		return extra.(*rtc.Method)
	}

	if isConstructor {
		root := methodObj.GetFieldValue("root", "Ljava/lang/reflect/Constructor;").(*rtc.Obj)
		return root.Extra().(*rtc.Method)
	} else {
		root := methodObj.GetFieldValue("root", "Ljava/lang/reflect/Method;").(*rtc.Obj)
		return root.Extra().(*rtc.Method)
	}
}
示例#3
0
文件: boxing.go 项目: cretz/jvm.go
func Unbox(obj *rtc.Obj, primitiveDescriptor string) Any {
	return obj.GetFieldValue("value", primitiveDescriptor)
}
示例#4
0
func _getPath(fileObj *rtc.Obj) string {
	pathStr := fileObj.GetFieldValue("path", "Ljava/lang/String;").(*rtc.Obj)
	return rtda.GoString(pathStr)
}
示例#5
0
// java.lang.String -> go string
func GoString(jStr *rtc.Obj) string {
	charArr := jStr.GetFieldValue("value", "[C").(*rtc.Obj)
	return _utf16ToString(charArr.Chars())
}