Andreas Wundsam | 661a222 | 2013-11-05 17:18:59 -0800 | [diff] [blame] | 1 | //:: import re |
| 2 | public ${prop.java_type.public_type} getCanonical() { |
| 3 | //:: if not msg.member_by_name("masked").value == "true": |
| 4 | // exact match OXM is always canonical |
| 5 | return this; |
| 6 | //:: else: |
| 7 | //:: mask_type = msg.member_by_name("mask").java_type.public_type |
| 8 | if (${mask_type}.NO_MASK.equals(mask)) { |
| 9 | //:: unmasked = re.sub(r'(.*)Masked(Ver.*)', r'\1\2', msg.name) |
| 10 | return new ${unmasked}(value); |
| 11 | } else if(${mask_type}.FULL_MASK.equals(mask)) { |
| 12 | return null; |
| 13 | } else { |
| 14 | return this; |
| 15 | } |
| 16 | //:: #endif |
| 17 | } |