As a developer attempting to expose a user-facing YAML document I want to have access to a
Property's annotations, so that I can easily configure the order of fields.
I only discovered the YAML document format a while ago and fell in love with it when I did. Our application involves a fairly sophisicated configuration stage, and we're in the process of adding command-line operation to our application, so we need a document format that can be hand-written by users. YAML jumped out at me.
The problem is that once the document has been given to our application, we would like to be able to constructor our native type from the document, and then represent that type in as close to the original document as possible.
this means giving our users an intuitive ~field~ order and then enforcing it on representation. I've already written some runtime facilities to keep track of source-code field order for JNA, so I'd like to leverage the existing facilities I have there to impose field order.
This means I need annotations, and i need to be able to get those annotations easily from your API.
I would like to change the
Properties class to support a
public Set<Annotation> getAnnotations();
method to the
This would simply return
field.getAnnotations() in the case of a
it would return the getter methods annotations in the case of a
MethodProperty, and the empty set in the case of the
Thanks to the simplicity and compactness of SnakeYAML, I'm fairly sure I can implement this. Let me know if I'm cleared to do this!