JAX-B
Instalação
Maven
<dependency>
<groupId>com.github.ljtfreitas</groupId>
<artifactId>java-restify-xml-jaxb-converter</artifactId>
<version>{version}</version>
</dependency>Gradle
dependencies {
compile("com.github.ljtfreitas:java-restify-xml-jaxb-converter:{version}")
}Utilização
public interface MyApi {
/* requisições e respostas com o content-type application/xml
serão automaticamente serializadas/deserializadas usando o jax-b */
@Path("/customers/{id}") @Get
Customer findCustomer(@PathParameter String id);
@Path("/customers") @Post
@XmlContent
Customer createCustomer(@BodyParameter Customer customer);
}Last updated