ElemName returns the transport element name of the given object key. It returns keyName if it's a key of the mapped attribute object type. It panics if there is no mapping and keyName is not a key.
(keyName string)
| 151 | // returns keyName if it's a key of the mapped attribute object type. It panics |
| 152 | // if there is no mapping and keyName is not a key. |
| 153 | func (ma *MappedAttributeExpr) ElemName(keyName string) string { |
| 154 | if n, ok := ma.nameMap[keyName]; ok { |
| 155 | return n |
| 156 | } |
| 157 | if att := AsObject(ma.Type).Attribute(keyName); att != nil { |
| 158 | return keyName |
| 159 | } |
| 160 | panic("Key " + keyName + " is not defined") // bug |
| 161 | } |
| 162 | |
| 163 | // KeyName returns the object key of the given transport element name. It |
| 164 | // returns elemName if it's a key of the mapped attribute object type. It panics |