PropertyValue adds a data property spec to the class instance.
(name string, spec ValueSpec, flags ...int)
| 232 | |
| 233 | // PropertyValue adds a data property spec to the class instance. |
| 234 | func (cb *ClassBuilder) PropertyValue(name string, spec ValueSpec, flags ...int) *ClassBuilder { |
| 235 | propFlags := PropertyDefault |
| 236 | if len(flags) > 0 { |
| 237 | propFlags = flags[0] |
| 238 | } |
| 239 | |
| 240 | cb.properties = append(cb.properties, PropertyEntry{ |
| 241 | Name: name, |
| 242 | Spec: spec, |
| 243 | Static: false, // Instance property |
| 244 | Flags: propFlags, |
| 245 | }) |
| 246 | return cb |
| 247 | } |
| 248 | |
| 249 | // PropertyLiteral adds a literal data property to the class instance. |
| 250 | func (cb *ClassBuilder) PropertyLiteral(name string, value interface{}, flags ...int) *ClassBuilder { |
no outgoing calls