4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
ImageAttribute.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: ImageAttribute.java
5  * Description: Class representing attribute of type Image
6  */
7 
8 package cz.vutbr.fit.knot.annotations.entity.attribute;
9 
11 import javax.persistence.DiscriminatorValue;
12 import javax.persistence.Entity;
13 import javax.persistence.NamedQueries;
14 import javax.persistence.NamedQuery;
15 
16 /**
17  * @file ImageAttribute.java
18  *
19  * @brief Class representing attribute of type Image
20  */
21 
22 /**
23  * Class representing attribute of type Image
24  *
25  * @brief Class representing attribute of type Image
26  */
27 @Entity
28 @DiscriminatorValue("Image")
29 @NamedQueries({
30  @NamedQuery(name = "Attribute.findByImageUri", query = "SELECT a FROM Attribute a WHERE a.uri = :uri"),
31 })
32 public class ImageAttribute extends StringAttribute {
33 
34  /**
35  * Gets value of the attribute
36  *
37  * @return Returns value of the attribute
38  */
39  @Override
40  public Object getValue() {
41  return this.uri;
42  }
43 
44  /**
45  * Sets value of the attribute. Value should already be a native java value.
46  *
47  * @param value New value of the attribute
48  */
49  @Override
50  public void setValue(Object value) {
51  this.uri = (String) value;
52  }
53 
54  /**
55  * Parses provided value and sets that value as a value of attribute
56  *
57  * @param value new value of the attribute in raw form from XML
58  */
59  @Override
60  public void setRawValue(String value) {
61  this.uri = value;
62  }
63 
64  /**
65  * Gets URI addres in ontology for this type of attribute
66  *
67  * @return Return URI addres in ontology for this type of attribute.
68  */
69  @Override
70  public String getTypeOntologyUri(){
71  return Constants.IMAGE_URI;
72  }
73 } // class ImageAttribute
Class representing attribute of type Image.
Class representing attribute of type String..