AbsoluteAttribute refers to a variable value and an optional qualifier path. The namespaceNames represent the names the variable could have based on namespace resolution rules.
(id int64, names ...string)
| 166 | // The namespaceNames represent the names the variable could have based on namespace |
| 167 | // resolution rules. |
| 168 | func (r *attrFactory) AbsoluteAttribute(id int64, names ...string) NamespacedAttribute { |
| 169 | disambiguateNames := false |
| 170 | for idx, name := range names { |
| 171 | if strings.HasPrefix(name, ".") { |
| 172 | disambiguateNames = true |
| 173 | names[idx] = strings.TrimPrefix(name, ".") |
| 174 | } |
| 175 | } |
| 176 | return &absoluteAttribute{ |
| 177 | id: id, |
| 178 | namespaceNames: names, |
| 179 | disambiguateNames: disambiguateNames, |
| 180 | qualifiers: []Qualifier{}, |
| 181 | adapter: r.adapter, |
| 182 | provider: r.provider, |
| 183 | fac: r, |
| 184 | errorOnBadPresenceTest: r.errorOnBadPresenceTest, |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | // ConditionalAttribute supports the case where an attribute selection may occur on a conditional |
| 189 | // expression, e.g. (cond ? a : b).c |