Skip to content

Instantly share code, notes, and snippets.

@develar
Created February 14, 2018 11:37
Show Gist options
  • Save develar/b58ec9a6493a5a7584d131401771b270 to your computer and use it in GitHub Desktop.
Save develar/b58ec9a6493a5a7584d131401771b270 to your computer and use it in GitHub Desktop.
Please consider to use annotation parameters only to achieve backward compatibility. Otherwise feel free to file issues about serialization cosmetics.
## Lists and Sets
`XCollection` annotation intended to customize lists and sets serialization.
Two styles are provided:
* `v1`:
```xml
<option name="propertyName">
<option value="value1" />
<option value="valueN" />
</option>
```
* `v2`:
```xml
<propertyName>
<option value="$value" />
</propertyName>
```
Where `option` it is item element (use `elementName` to customize element name) and
`value` it is value attribute (use `valueAttributeName` to customize attribute name).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment