HasTag returns true if the attribute is an object that has an attribute with the given tag.
(tag string)
| 504 | // HasTag returns true if the attribute is an object that has an attribute with |
| 505 | // the given tag. |
| 506 | func (a *AttributeExpr) HasTag(tag string) bool { |
| 507 | if a == nil { |
| 508 | return false |
| 509 | } |
| 510 | obj := AsObject(a.Type) |
| 511 | if obj == nil { |
| 512 | return false |
| 513 | } |
| 514 | for _, at := range *obj { |
| 515 | if _, ok := at.Attribute.Meta[tag]; ok { |
| 516 | return true |
| 517 | } |
| 518 | } |
| 519 | return false |
| 520 | } |
| 521 | |
| 522 | // HasTagPrefix returns true if the attribute is an object that has an attribute with |
| 523 | // the given tag prefix. |