示例#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
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
func Unbox(obj *rtc.Obj, primitiveDescriptor string) interface{} {
	return obj.GetFieldValue("value", primitiveDescriptor)
}
示例#4
0
// java.lang.String -> go string
func GoString(jStr *rtc.Obj) string {
	charArr := jStr.GetFieldValue("value", "[C").(*rtc.Obj)
	return _utf16ToString(charArr.Chars())
}
示例#5
0
func _getPath(fileObj *rtc.Obj) string {
	pathStr := fileObj.GetFieldValue("path", "Ljava/lang/String;").(*rtc.Obj)
	return rtda.GoString(pathStr)
}