Skip to content

Instantly share code, notes, and snippets.

@ssedano
Created February 24, 2012 13:18
Show Gist options
  • Save ssedano/1900851 to your computer and use it in GitHub Desktop.
Save ssedano/1900851 to your computer and use it in GitHub Desktop.
Naive and crappy regexp (eclipse)
Remember: does not take into account void methods (no @Produces) both out and in are the same return value.
(@GET(\n\s+@.*)*)\n(\s+public\s)(\w*Dto)
\1 @Produces(\4.MEDIA_TYPE) \3 \4
(@POST(\n\s+@.*)*)\n(\s+public\s)(\w*Dto)
\1 @Consumes(\4.MEDIA_TYPE) @Produces(\4.MEDIA_TYPE) \3 \4
(@PUT(\n\s+@.*)*)\n(\s+public\s)(\w*Dto)
\1 @Consumes(\4.MEDIA_TYPE) @Produces(\4.MEDIA_TYPE) \3 \4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment