@Path(value="elements") public class PeriodicTableResource extends Object
Constructor and Description |
---|
PeriodicTableResource() |
Modifier and Type | Method and Description |
---|---|
String |
getElementsAsHtml(javax.ws.rs.core.UriInfo uriInfo)
Gets all the Elements of the Periodic Table in HTML format.
|
List<Element> |
getElementsAsJasonOrXml()
Gets all the Elements of the Periodic Table.
|
PeriodicTableElementResource |
getPeriodicTableElementResource(Long id)
Gets the sub resource to handle the "{element}" part of the path.
|
@GET @Produces(value={"application/json","application/xml"}) public List<Element> getElementsAsJasonOrXml()
curl --header Accept:application/json --get http://localhost:8080/josef-demo-rest-ws/resources/elements
curl --header Accept:application/xml --get http://localhost:8080/josef-demo-rest-ws/resources/elements
javax.ws.rs.InternalServerErrorException
- When the elements could not be fetched from the database.@GET @Produces(value="text/html;q=0.7") public String getElementsAsHtml(@Context javax.ws.rs.core.UriInfo uriInfo)
curl --header Accept:text/html --get http://localhost:8080/josef-demo-rest-ws/resources/elements
uriInfo
- URI Info to create links.javax.ws.rs.InternalServerErrorException
- When the elements could not be fetched from the database.@Path(value="{element}") public PeriodicTableElementResource getPeriodicTableElementResource(@PathParam(value="element") Long id)
id
- The id of the Element.Copyright © 2008–2018. All rights reserved.