Annotate the given schema with the encryption information. Format of the string is a key-list. key-list = key (';' key-list)? key = key-name ':' field-list field-list = field-name ( ',' field-list )? field-name = number | field-part ('.' field-name)?
(StringPosition source, TypeDescription schema)
| 526 | * @throws IllegalArgumentException if there are conflicting keys for a field |
| 527 | */ |
| 528 | public static void parseKeys(StringPosition source, TypeDescription schema) { |
| 529 | if (source.hasCharactersLeft()) { |
| 530 | do { |
| 531 | String keyName = parseName(source); |
| 532 | requireChar(source, ':'); |
| 533 | for (TypeDescription field : findSubtypeList(schema, source)) { |
| 534 | String prev = field.getAttributeValue(TypeDescription.ENCRYPT_ATTRIBUTE); |
| 535 | if (prev != null && !prev.equals(keyName)) { |
| 536 | throw new IllegalArgumentException("Conflicting encryption keys " + |
| 537 | keyName + " and " + prev); |
| 538 | } |
| 539 | field.setAttribute(TypeDescription.ENCRYPT_ATTRIBUTE, keyName); |
| 540 | } |
| 541 | } while (consumeChar(source, ';')); |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | /** |
| 546 | * Annotate the given schema with the masking information. |
no test coverage detected