Lines Matching full:reflect
18 "reflect"
200 Type reflect.Type
208 Value reflect.Value
231 Type reflect.Type
270 e.reflectValue(reflect.ValueOf(v))
278 func isEmptyValue(v reflect.Value) bool {
280 case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
282 case reflect.Bool:
284 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
286 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
288 case reflect.Float32, reflect.Float64:
290 case reflect.Interface, reflect.Ptr:
296 func (e *encodeState) reflectValue(v reflect.Value) {
300 type encoderFunc func(e *encodeState, v reflect.Value, quoted bool)
304 m map[reflect.Type]encoderFunc
307 func valueEncoder(v reflect.Value) encoderFunc {
314 func typeEncoder(t reflect.Type) encoderFunc {
328 encoderCache.m = make(map[reflect.Type]encoderFunc)
332 encoderCache.m[t] = func(e *encodeState, v reflect.Value, quoted bool) {
349 marshalerType = reflect.TypeOf(new(Marshaler)).Elem()
350 textMarshalerType = reflect.TypeOf(new(encoding.TextMarshaler)).Elem()
355 func newTypeEncoder(t reflect.Type, allowAddr bool) encoderFunc {
359 if t.Kind() != reflect.Ptr && allowAddr {
360 if reflect.PtrTo(t).Implements(marshalerType) {
368 if t.Kind() != reflect.Ptr && allowAddr {
369 if reflect.PtrTo(t).Implements(textMarshalerType) {
375 case reflect.Bool:
377 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
379 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
381 case reflect.Float32:
383 case reflect.Float64:
385 case reflect.String:
387 case reflect.Interface:
389 case reflect.Struct:
391 case reflect.Map:
393 case reflect.Slice:
395 case reflect.Array:
397 case reflect.Ptr:
404 func invalidValueEncoder(e *encodeState, v reflect.Value, quoted bool) {
408 func marshalerEncoder(e *encodeState, v reflect.Value, quoted bool) {
409 if v.Kind() == reflect.Ptr && v.IsNil() {
424 func addrMarshalerEncoder(e *encodeState, v reflect.Value, quoted bool) {
441 func textMarshalerEncoder(e *encodeState, v reflect.Value, quoted bool) {
442 if v.Kind() == reflect.Ptr && v.IsNil() {
456 func addrTextMarshalerEncoder(e *encodeState, v reflect.Value, quoted bool) {
472 func boolEncoder(e *encodeState, v reflect.Value, quoted bool) {
486 func intEncoder(e *encodeState, v reflect.Value, quoted bool) {
497 func uintEncoder(e *encodeState, v reflect.Value, quoted bool) {
510 func (bits floatEncoder) encode(e *encodeState, v reflect.Value, quoted bool) {
530 func stringEncoder(e *encodeState, v reflect.Value, quoted bool) {
550 func interfaceEncoder(e *encodeState, v reflect.Value, quoted bool) {
558 func unsupportedTypeEncoder(e *encodeState, v reflect.Value, quoted bool) {
567 func (se *structEncoder) encode(e *encodeState, v reflect.Value, quoted bool) {
587 func newStructEncoder(t reflect.Type) encoderFunc {
603 func (me *mapEncoder) encode(e *encodeState, v reflect.Value, _ bool) {
622 func newMapEncoder(t reflect.Type) encoderFunc {
623 if t.Key().Kind() != reflect.String {
630 func encodeByteSlice(e *encodeState, v reflect.Value, _ bool) {
657 func (se *sliceEncoder) encode(e *encodeState, v reflect.Value, _ bool) {
665 func newSliceEncoder(t reflect.Type) encoderFunc {
667 if t.Elem().Kind() == reflect.Uint8 {
678 func (ae *arrayEncoder) encode(e *encodeState, v reflect.Value, _ bool) {
690 func newArrayEncoder(t reflect.Type) encoderFunc {
699 func (pe *ptrEncoder) encode(e *encodeState, v reflect.Value, quoted bool) {
707 func newPtrEncoder(t reflect.Type) encoderFunc {
716 func (ce *condAddrEncoder) encode(e *encodeState, v reflect.Value, quoted bool) {
750 func fieldByIndex(v reflect.Value, index []int) reflect.Value {
752 if v.Kind() == reflect.Ptr {
754 return reflect.Value{}
763 func typeByIndex(t reflect.Type, index []int) reflect.Type {
765 if t.Kind() == reflect.Ptr {
773 // stringValues is a slice of reflect.Value holding *reflect.StringValue.
775 type stringValues []reflect.Value
942 typ reflect.Type
997 func typeFields(t reflect.Type) []field {
1003 count := map[reflect.Type]int{}
1004 nextCount := map[reflect.Type]int{}
1007 visited := map[reflect.Type]bool{}
1014 count, nextCount = nextCount, map[reflect.Type]int{}
1041 if ft.Name() == "" && ft.Kind() == reflect.Ptr {
1050 case reflect.Bool,
1051 reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
1052 reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
1053 reflect.Float32, reflect.Float64,
1054 reflect.String:
1060 if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct {
1168 m map[reflect.Type][]field
1172 func cachedTypeFields(t reflect.Type) []field {
1189 fieldCache.m = map[reflect.Type][]field{}