added documentation for annotations

Added the documentation and example for the annotations of the new java api.