attrQualifyIfPresent conditionally performs the qualification of the result of attribute is present on the target object.
(fac AttributeFactory, vars Activation, obj any, qualAttr Attribute, presenceOnly bool)
| 1351 | // attrQualifyIfPresent conditionally performs the qualification of the result of attribute is present |
| 1352 | // on the target object. |
| 1353 | func attrQualifyIfPresent(fac AttributeFactory, vars Activation, obj any, qualAttr Attribute, |
| 1354 | presenceOnly bool) (any, bool, error) { |
| 1355 | val, err := qualAttr.Resolve(vars) |
| 1356 | if err != nil { |
| 1357 | return nil, false, err |
| 1358 | } |
| 1359 | qual, err := fac.NewQualifier(nil, qualAttr.ID(), val, qualAttr.IsOptional()) |
| 1360 | if err != nil { |
| 1361 | return nil, false, err |
| 1362 | } |
| 1363 | return qual.QualifyIfPresent(vars, obj, presenceOnly) |
| 1364 | } |
| 1365 | |
| 1366 | // refQualify attempts to convert the value to a CEL value and then uses reflection methods to try and |
| 1367 | // apply the qualifier with the option to presence test field accesses before retrieving field values. |
no test coverage detected