MaybeAttribute implementation of the AttributeFactory interface which ensure that the set of 'maybe' NamespacedAttribute values are produced using the partialAttributeFactory rather than the base AttributeFactory implementation.
(id int64, name string)
| 208 | // 'maybe' NamespacedAttribute values are produced using the partialAttributeFactory rather than |
| 209 | // the base AttributeFactory implementation. |
| 210 | func (fac *partialAttributeFactory) MaybeAttribute(id int64, name string) Attribute { |
| 211 | var names []string |
| 212 | // When there's a single name with a dot prefix, it indicates that the 'maybe' attribute is a |
| 213 | // globally namespaced identifier. |
| 214 | if strings.HasPrefix(name, ".") { |
| 215 | names = append(names, name) |
| 216 | } else { |
| 217 | // In all other cases, the candidate names should be inferred. |
| 218 | names = fac.container.ResolveCandidateNames(name) |
| 219 | } |
| 220 | return &maybeAttribute{ |
| 221 | id: id, |
| 222 | attrs: []NamespacedAttribute{ |
| 223 | fac.AbsoluteAttribute(id, names...), |
| 224 | }, |
| 225 | adapter: fac.adapter, |
| 226 | provider: fac.provider, |
| 227 | fac: fac, |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | // matchesUnknownPatterns returns true if the variable names and qualifiers for a given |
| 232 | // Attribute value match any of the ActivationPattern objects in the set of unknown activation |
nothing calls this directly
no test coverage detected