addReflectionMethods scans struct methods and adds them to the ClassBuilder Only exported methods are processed due to Go reflection limitations
(builder *ClassBuilder, typ reflect.Type, opts *ReflectOptions)
| 251 | // addReflectionMethods scans struct methods and adds them to the ClassBuilder |
| 252 | // Only exported methods are processed due to Go reflection limitations |
| 253 | func addReflectionMethods(builder *ClassBuilder, typ reflect.Type, opts *ReflectOptions) { |
| 254 | // Get pointer type to include pointer receiver methods |
| 255 | ptrTyp := reflect.PointerTo(typ) |
| 256 | |
| 257 | for i := 0; i < ptrTyp.NumMethod(); i++ { |
| 258 | method := ptrTyp.Method(i) |
| 259 | |
| 260 | if shouldSkipMethod(method, opts) { |
| 261 | continue |
| 262 | } |
| 263 | |
| 264 | // Create method wrapper and add to builder |
| 265 | methodWrapper := createMethodWrapper(method) |
| 266 | builder.Method(method.Name, methodWrapper) |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | // addReflectionAccessors scans struct fields and adds them as accessors |
| 271 | // Only exported fields are processed to maintain Go encapsulation principles |
no test coverage detected