代码拉取完成,页面将自动刷新
package reflectx
type IRefObject interface {
// RefType 结构的类名
RefType() string
}
type IRefType interface {
// RefType 结构的类名
RefType() string
// RefNew 生成结构
RefNew() IRefObject
}
type IRefField interface {
IRefType
// RefHas 是否包含字段
RefHas(field string) bool
// RefGet 获取field的值
RefGet(obj IRefObject, field string) (val interface{}, isNil bool)
// RefSet 设置field的值
RefSet(obj IRefObject, field string, val interface{})
}
type IRefMap interface {
IRefField
RefMapGet(obj IRefObject, field string, key string) (val interface{}, isNil bool)
RefMapSet(obj IRefObject, field string, key string, val interface{})
RefMapKeys(obj IRefObject, field string) []string
RefMapNew(field string) interface{}
}
type IRefSlice interface {
IRefField
RefSliceGet(obj IRefObject, field string, index int) (val interface{}, isNil bool)
RefSliceSet(obj IRefObject, field string, index int, val interface{})
RefSliceNew(field string, len int, cap int) interface{}
RefSliceLength(obj IRefObject, field string) int
}
func init() {
list := []IRefType{
&ClassDeclRef{},
&InterfaceDeclRef{},
&FieldRef{},
&EnumDeclRef{},
&AnyTypeRef{},
&BasicTypeRef{},
&ClassTypeRef{},
&EnumTypeRef{},
&MapTypeRef{},
&ArrayTypeRef{},
&FuncTypeRef{},
}
for _, val := range list {
AddType(val)
}
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。