1 package com.atlassian.plugins.rest.test;
2
3 import com.atlassian.plugins.rest.common.Link;
4 import com.atlassian.plugins.rest.common.expand.Expander;
5
6 import javax.ws.rs.core.UriInfo;
7
8 import static javax.xml.bind.annotation.XmlAccessType.*;
9
10 import javax.xml.bind.annotation.XmlAccessorType;
11 import javax.xml.bind.annotation.XmlAttribute;
12 import javax.xml.bind.annotation.XmlElement;
13 import javax.xml.bind.annotation.XmlRootElement;
14
15 @XmlRootElement
16 @XmlAccessorType(FIELD)
17 @Expander(ProjectSpecificationExpander.class)
18 public class ProjectSpecification {
19 @XmlElement
20 private Link link;
21
22 @XmlAttribute
23 private String title;
24
25 @XmlElement
26 private String text;
27
28 public String getTitle() {
29 return title;
30 }
31
32 public void setTitle(String title) {
33 this.title = title;
34 }
35
36 public String getText() {
37 return text;
38 }
39
40 public void setText(String text) {
41 this.text = text;
42 }
43
44 public Link getLink() {
45 return link;
46 }
47
48 public void setLink(Link link) {
49 this.link = link;
50 }
51
52 public static ProjectSpecification getSpecification(UriInfo uriInfo) {
53 final ProjectSpecification projectSpecification = new ProjectSpecification();
54 projectSpecification.setLink(Link.self(uriInfo.getAbsolutePathBuilder().path("spec").build()));
55 return projectSpecification;
56 }
57 }