Skip to content

Commit

Permalink
Corrected README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgang-wiedermann committed May 24, 2016
1 parent 83df01c commit 4a049b7
Showing 1 changed file with 68 additions and 67 deletions.
135 changes: 68 additions & 67 deletions README.md
Expand Up @@ -86,73 +86,6 @@ to getters and setters, it generates a validation function which supplies
a useful way to check the validity of the content of the attributes
within the object.

```java
/*
* de/ww/sample/CustomerRepository.java
*/
package de.ww.sample;

import java.util.ArrayList;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.DELETE;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.PathParam;
import javax.ws.rs.Consumes;
import de.ww.sample.entities.Customer;

/**
* Generated Interface for CustomerRepository with JAX-RS Annotations
*/
@Path("/api")
public interface CustomerRepository {

/**
* @param id
* @return Customer
*/
@GET
@Path("/customer/{id}")
@Produces("application/json")
public Customer getCustomerById(@PathParam("id") int id);

/**
* @param prename
* @param surname
* @return ArrayList<customer>
*/
@GET
@Path("/customer")
@Produces("application/json")
public ArrayList<customer> findCustomer(@QueryParam("prename") String prename, @QueryParam("surname") String surname);

/**
* @param c
* @return Customer
*/
@POST
@Path("/customer")
@Produces("application/json")
@Consumes("application/json")
public Customer createCustomer(Customer c);

/**
* @param id
* @return int
*/
@DELETE
@Path("/customer/{id}")
public int deleteCustomer(@PathParam("id") int id);
}
```

Additional to the generated types, staticjson supports the generation of
interfaces. So its a fully featured interface definition language for http based
rest like interfaces. The following code listing is the result of the jaxrs generator
and shows a JAX-RS interface.

```java

/*
Expand Down Expand Up @@ -227,6 +160,74 @@ public class Customer implements Serializable {

```

Additional to the generated types, staticjson supports the generation of
interfaces. So its a fully featured interface definition language for http based
rest like interfaces. The following code listing is the result of the jaxrs generator
and shows a JAX-RS interface.

```java
/*
* de/ww/sample/CustomerRepository.java
*/
package de.ww.sample;

import java.util.ArrayList;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.DELETE;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.PathParam;
import javax.ws.rs.Consumes;
import de.ww.sample.entities.Customer;

/**
* Generated Interface for CustomerRepository with JAX-RS Annotations
*/
@Path("/api")
public interface CustomerRepository {

/**
* @param id
* @return Customer
*/
@GET
@Path("/customer/{id}")
@Produces("application/json")
public Customer getCustomerById(@PathParam("id") int id);

/**
* @param prename
* @param surname
* @return ArrayList<customer>
*/
@GET
@Path("/customer")
@Produces("application/json")
public ArrayList<customer> findCustomer(@QueryParam("prename") String prename, @QueryParam("surname") String surname);

/**
* @param c
* @return Customer
*/
@POST
@Path("/customer")
@Produces("application/json")
@Consumes("application/json")
public Customer createCustomer(Customer c);

/**
* @param id
* @return int
*/
@DELETE
@Path("/customer/{id}")
public int deleteCustomer(@PathParam("id") int id);
}

```

## Call the client proxy code generation

```bash
Expand Down

0 comments on commit 4a049b7

Please sign in to comment.