View Javadoc

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   import static javax.xml.bind.annotation.XmlAccessType.*;
8   import javax.xml.bind.annotation.XmlAccessorType;
9   import javax.xml.bind.annotation.XmlAttribute;
10  import javax.xml.bind.annotation.XmlElement;
11  import javax.xml.bind.annotation.XmlRootElement;
12  
13  @XmlRootElement
14  @XmlAccessorType(FIELD)
15  @Expander(ProjectSpecificationExpander.class)
16  public class ProjectSpecification
17  {
18      @XmlElement
19      private Link link;
20  
21      @XmlAttribute
22      private String title;
23  
24      @XmlElement
25      private String text;
26  
27      public String getTitle()
28      {
29          return title;
30      }
31  
32      public void setTitle(String title)
33      {
34          this.title = title;
35      }
36  
37      public String getText()
38      {
39          return text;
40      }
41  
42      public void setText(String text)
43      {
44          this.text = text;
45      }
46  
47      public Link getLink()
48      {
49          return link;
50      }
51  
52      public void setLink(Link link)
53      {
54          this.link = link;
55      }
56  
57      public static ProjectSpecification getSpecification(UriInfo uriInfo)
58      {
59          final ProjectSpecification projectSpecification = new ProjectSpecification();
60          projectSpecification.setLink(Link.self(uriInfo.getAbsolutePathBuilder().path("spec").build()));
61          return projectSpecification;
62      }
63  }