Closed petarov closed 4 years ago
Hi, it seems that this feature has not been released? @3breadt
No, it was never included in the official branch. Please use a more appropriate format for de-/serialization of objects, like JSON.
No, it was never included in the official branch. Please use a more appropriate format for de-/serialization of objects, like JSON.
Thanks. But I have another question: How to convert a plist string into a NSObject or a POJO?
Sorry @extraSix, but this is not the right place for such questions. Please refer to the example given in the readme and for your specific use case this article on converting a String to an InputStream.
Sorry @extraSix, but this is not the right place for such questions. Please refer to the example given in the readme and for your specific use case this article on converting a String to an InputStream.
My fault. I got it. Thank you.
This PR adds support for annotations when serializing and deserializing Java classes. I needed this in a project I'm working on that creates/parses Apple Configurator Plist config files.
I did not want to introduce potential breaking changes in the already existing Pojo serialization code, therefore the new functionality I have added is only enforceable when the
@PlistOptions
annotation is denoted on a Java class.Here's a short documentation, also included in the README file.
@PlistOptions
at the top of a class to denote that annotations will be used. Use@PlistOptions(upperCamelCase = true)
to specify that all fields should be serialized in upper camel-case mode, i.e., first letter is always an upper case letter.@PlistIgnore
on a class field to omit it from serialization. Alternatively you may use thetransient
field modifier.@PlistAlias
on a class field to specify the serialized name of a field.@PlistInclude
on a class or field to specify how empty ornull
field values should be serialized.Feedback is welcome. Cheers 🍺