4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
SugUriAttribute.java
Go to the documentation of this file.
1 /*
2  * Project: Server for annotations sharing
3  * Author: Ing. Jaroslav Dytrych idytrych@fit.vutbr.cz
4  * File: SugUriAttribute.java
5  * Description: Class representing attribute of type URI for prupose of suggestion
6  */
7 package cz.vutbr.fit.knot.annotations.modules.suggestionManager.attributes;
8 
11 import javax.persistence.DiscriminatorValue;
12 import javax.persistence.Entity;
13 import javax.persistence.NamedQueries;
14 import javax.persistence.NamedQuery;
15 
16 /**
17  * @file SugUriAttribute.java
18  *
19  * @brief Class representing attribute of type URI for prupose of suggestion
20  */
21 
22 /**
23  * Class representing attribute of type URI for prupose of suggestion
24  *
25  * @brief Class representing attribute of type URI for prupose of suggestion
26  */
27 @Entity
28 @DiscriminatorValue(value="URI")
29 @NamedQueries({
30  @NamedQuery(name = "SuggestionAttribute.findByUri", query = "SELECT a FROM SuggestionAttribute a WHERE a.uri = :uri"),
31 })
32 public class SugUriAttribute extends SugStringAttribute{
33  /**
34  * Constructor
35  */
36  public SugUriAttribute() {
37  }
38 
39  /**
40  * Constructor
41  *
42  * @param name Name of attribute
43  * @param uri Value of attribute
44  * @param refSuggestion Suggestion to which this attribute belongs
45  */
46  public SugUriAttribute(String name, String uri, Suggestion refSuggestion) {
47  this.name = name;
48  this.simpleType = "URI";
49  this.uri = uri;
50  this.refSuggestion = refSuggestion;
51  }
52 
53  /**
54  * Constructor
55  *
56  * @param name Name of attribute
57  * @param uri Value of attribute
58  * @param refSuggestion Suggestion to which this attribute belongs
59  * @param priority Priority of attribute
60  */
61  public SugUriAttribute(String name, String uri, Suggestion refSuggestion, Integer priority) {
62  this.name = name;
63  this.simpleType = "URI";
64  this.uri = uri;
65  this.refSuggestion = refSuggestion;
66  this.priority = priority;
67  }
68 
69 
70  /**
71  * Gets value of the attribute
72  *
73  * @return value of the attribute
74  */
75  @Override
76  public Object getValue() {
77  return this.uri;
78  }
79 
80  /**
81  * Sets value of the attribute
82  *
83  * @param value New value of the attribute
84  */
85  @Override
86  public void setValue(Object value) {
87  this.uri = (String) value;
88  }
89 
90  /**
91  * Parses provided value and sets that value as a value of attribute
92  *
93  * @param value new value of the attribute in raw form from XML
94  */
95  @Override
96  public void setRawValue(String value) {
97  this.uri = value;
98  }
99 
100  /**
101  * Gets URI addres in ontology for this type of attribute
102  *
103  * @return Return URI addres in ontology for this type of attribute.
104  */
105  @Override
106  public String getTypeOntologyUri(){
108  }
109 }
Class representing attribute of type URI for prupose of suggestion.
SugUriAttribute(String name, String uri, Suggestion refSuggestion, Integer priority)
Class representing attribute of type String for prupose of suggestion.
Class representing suggestion of annotation.
Definition: Suggestion.java:87