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