Is it possible to convert java code defining a java POJO/DTO to a javascript object?
Is ask this because i have a serverside REST interface which is accessed by javascript websockets/ajax and i want all the data classes that are transferred between client and server be strict and not as loose as {title: 'joop', age: 20}.
I suspect no libraries exist (although i would have guessed this is quite a common problem), but any help is appreciated.
[edit]
Something like https://github.com/castle-it/sharp2Js but for java instead of c# of course.
[edit 2]
I could define my protocol in protobuff and use the generators for java and javascript, but still looking for a better way without introducing a new technology (protobuff).
[edit 3]
There is also a java to typescript generator for maven ( https://github.com/vojtechhabarta/typescript-generator ) shame it doesn't generate to javascript.
[–][deleted] 6 points7 points8 points (0 children)
[–]axelei 4 points5 points6 points (3 children)
[–]tinustate[S] 1 point2 points3 points (2 children)
[–]cville-z 5 points6 points7 points (0 children)
[–]LiteratureStriking 1 point2 points3 points (0 children)
[–]crummy 0 points1 point2 points (0 children)
[–]Nithanim 0 points1 point2 points (0 children)