Permalink
Browse files

Fix Javadoc

  • Loading branch information...
1 parent 1bf0e07 commit 06e3612835c4f59105eec940af098ebd1cbcbd81 @jfarcand jfarcand committed Jun 17, 2011
@@ -16,21 +16,20 @@
*
* An action is associated with one or more {@link ServiceHandler}. The {@link ServiceHandler} gets mapped from the URI
* and then its associated Action gets invoked. As an example, a pet action could look like
- * {@code
-
- public class PetstoreAction implements Action<Pet, Pet> {
+ * <p><blockquote><pre>
+ public class PetstoreAction implements Action&lt;Pet, Pet&gt; {
public final static String APPLICATION = "application";
public final static String JSON = "vnd.org.sonatype.rest+json";
public final static String XML = "vnd.org.sonatype.rest+xml";
public final static String PET_EXTRA_NAME = "petType";
- private final ConcurrentHashMap<String, Pet> pets = new ConcurrentHashMap<String, Pet>();
+ private final ConcurrentHashMap&lt;String, Pet&gt; pets = new ConcurrentHashMap&lt;String, Pet&gt;();
- @Override
- public Pet action(ActionContext<Pet> actionContext) throws ActionException {
- Map<String, Collection<String>> headers = actionContext.headers();
- Map<String, Collection<String>> paramsString = actionContext.paramsString();
+ &#64;Override
+ public Pet action(ActionContext&lt;Pet&gt; actionContext) throws ActionException {
+ Map&lt;String, Collection&lt;String&gt;&gt; headers = actionContext.headers();
+ Map&lt;String, Collection&lt;String&gt;&gt; paramsString = actionContext.paramsString();
switch (actionContext.method()) {
case GET:
@@ -46,9 +45,7 @@ public Pet action(ActionContext<Pet> actionContext) throws ActionException {
throw new ActionException(405);
}
}
- }
-
- }
+ }</pre></blockquote>
* You can use the {@link TypedAction} for an implementation of an {@link Action}
*
* The de-serialization of the Request's body is always performed before the {@link Action#action} and the result can
@@ -20,7 +20,7 @@
* that can be deployed or integrated into other framework like SiteBricks or Jersey (JAXRS).
*
* As an example, the following ServiceDefinition
- * {@code
+ * <p><blockquote><pre>
*
Injector injector = Guice.createInjector(new RestSimpleSitebricksModule(binder()));
Action action = new PetstoreAction();
@@ -30,7 +30,7 @@
.withHandler(new GetServiceHandler("/{getPet}", action).consumeWith(JSON, Pet.class).producing(JSON))
.withHandler(new PostServiceHandler("/{addPet}", action).consumeWith(JSON, Pet.class).producing(JSON))
.bind();
- * }
+ * }</pre></blockquote>
* can easily be translated into a JAXRS resources by using the restsimple-jaxrs extension. A ServiceDefinition can be
* seen as a DSL for REST application.
*
@@ -15,10 +15,10 @@
* Simple {@link Action} that delegate the HTTP method operation to proper method implementation of GET, POST, PUT and
* DELETE. By default all method are throwing an exception with the status code set to 405 (NOT SUPPORTED). Override the
* proper method.
- * {@code
+ * <p><blockquote><pre>
* public class PetstoreAction extends TypedAction<Pet, Pet> {
*
- @Override
+ &#64;Override
public Pet get(ActionContext<Pet> actionContext) {
String pathValue = actionContext.pathParams().get("pet");
Map<String, Collection<String>> headers = actionContext.headers();
@@ -27,7 +27,7 @@ public Pet get(ActionContext<Pet> actionContext) {
return pet;
}
- @Override
+ &#64;Override
public Pet post(ActionContext<Pet> actionContext) {
Map<String, Collection<String>> headers = actionContext.headers();
Map<String, Collection<String>> queryStrings = actionContext.paramsString();
@@ -40,14 +40,14 @@ public Pet post(ActionContext<Pet> actionContext) {
return pet;
}
- @Override
+ &#64;Override
public Pet delete(ActionContext<Pet> actionContext) {
String pathValue = actionContext.pathParams().get("pet");
return pets.remove(pathValue);
}
* }
- * }
+ * </pre></blockquote>
*
* @param <T>
* @param <V>
@@ -58,10 +58,10 @@
* </pre>
* The class can also be used without a service definition. All the request information must be "manually" configured.
* <pre>
- * {@code
+ * <p><blockquote><pre>
*
Web web = new WebAHCClient();
- Map<String, String> m = new HashMap<String, String>();
+ Map&lt;String, String&gt; m = new HashMap&lt;String, String&gt;();
m.put("Content-Type", acceptHeader);
m.put("Accept", acceptHeader);
@@ -70,7 +70,7 @@
.post(new Pet("pouetpouet"), Pet.class);
*
* }
- * </pre>
+ * </pre></blockquote>
* The client support content negotiation as defined in RFC 2295 via the
* {@link WebAHCClient#supportedContentType(org.sonatype.restsimple.api.MediaType)}
*
@@ -56,29 +56,29 @@
/**
* A simple proxy that generates RestSimple client from an annotated interface.
- * As simple as {code
- * {@code
+ * As simple as
+ * <p><blockquote><pre>
* public static interface ProxyClient {
*
- * @Get
- * @Path("getPet")
- * @Produces("application/json")
- * public Pet get(@PathParam("myPet") String path);
- * <p>
- * @Get
- * @Path("getPetString")
- * @Produces("application/json")
- * public String getString(@PathParam("myPet") String path);
- * <p></p>
- * @Post
- * @Path("addPet")
- * @Produces("application/json")
- * public Pet post(@PathParam("myPet") String myPet, String body);
- * <p>
- * @Delete
- * @Path("deletePet")
- * @Produces("application/json")
- * public Pet delete(@PathParam("myPet") String path);
+ * &#64;Get
+ * &#64;Path("getPet")
+ * &#64;Produces("application/json")
+ * public Pet get(&#64;PathParam("myPet") String path);
+ *
+ * &#64;Get
+ * &#64;Path("getPetString")
+ * &#64;Produces("application/json")
+ * public String getString(&#64;PathParam("myPet") String path);
+ *
+ * &#64;Post
+ * &#64;Path("addPet")
+ * &#64;Produces("application/json")
+ * public Pet post(&#64;PathParam("myPet") String myPet, String body);
+ *
+ * &#64;Delete
+ * &#64;Path("deletePet")
+ * &#64;Produces("application/json")
+ * public Pet delete(&#64;PathParam("myPet") String path);
* <p/>
* }
* }
@@ -88,7 +88,7 @@
* ProxyClient client = WebProxy.createProxy(ProxyClient.class, URI.create("http://someurl/));
* Pet pet = client.post("myPet", "{\"name\":\"pouetpouet\"}");
* <p/>
- * }
+ * </pre></blockquote>
*/
public class WebProxy {

0 comments on commit 06e3612

Please sign in to comment.