public class SomeCode { @ScriptDocumentation(desc = "Method returns Collection of Roles from given User Id", params = { "userId (mandatory) - Id of User." }) public static Collection getGlobalRoles(String userId) throws Exception { if (userId == null | userId.equals("")) { throw new CustomException(ErrorMessage.NULL, SomeCode.class, "getGlobalRoles"); } AService securityService = getSecurityService(); return securityService.getRolesForUser(userId); } /** * If only $tagForVelocity is used in a wiki page, then the annotated * documentation is shown for all available methods. */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ScriptDocumentation.ServiceDisplay.createString(SomeCode.class)); return sb.toString(); } }