Lines Matching full:reflect
12 "reflect"
29 // Because Unmarshal uses the reflect package, it can only assign
129 val := reflect.ValueOf(v)
130 if val.Kind() != reflect.Ptr {
174 t := reflect.TypeOf(val)
228 func (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error {
229 if val.Kind() == reflect.Ptr {
231 val.Set(reflect.New(val.Type().Elem()))
266 unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
267 unmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem()
268 textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
272 func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error {
289 if val.Kind() == reflect.Interface && !val.IsNil() {
291 if e.Kind() == reflect.Ptr && !e.IsNil() {
296 if val.Kind() == reflect.Ptr {
298 val.Set(reflect.New(val.Type().Elem()))
329 saveData reflect.Value
331 saveComment reflect.Value
332 saveXML reflect.Value
335 saveAny reflect.Value
336 sv reflect.Value
345 case reflect.Interface:
351 case reflect.Slice:
353 if typ.Elem().Kind() == reflect.Uint8 {
367 new := reflect.MakeSlice(typ, n, ncap)
368 reflect.Copy(new, v)
380 case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.String:
383 case reflect.Struct:
386 v.Set(reflect.ValueOf(start.Name))
413 fv.Set(reflect.ValueOf(start.Name))
521 saveData = reflect.Value{}
530 saveData = reflect.Value{}
539 case reflect.String:
541 case reflect.Slice:
542 t.Set(reflect.ValueOf(comment))
546 case reflect.String:
548 case reflect.Slice:
549 reflect.ValueOf(saveXMLData))
555 func copyValue(dst reflect.Value, src []byte) (err error) {
558 if dst.Kind() == reflect.Ptr {
560 dst.Set(reflect.New(dst.Type().Elem()))
567 case reflect.Invalid:
571 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
577 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
583 case reflect.Float32, reflect.Float64:
589 case reflect.Bool:
595 case reflect.String:
597 case reflect.Slice:
612 func (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) {