1 | package clarin.cmdi.componentregistry.model; |
---|
2 | |
---|
3 | import java.text.DateFormat; |
---|
4 | import java.text.SimpleDateFormat; |
---|
5 | import java.util.Locale; |
---|
6 | |
---|
7 | import javax.xml.bind.annotation.XmlAccessType; |
---|
8 | import javax.xml.bind.annotation.XmlAccessorType; |
---|
9 | import javax.xml.bind.annotation.XmlElement; |
---|
10 | import javax.xml.bind.annotation.XmlSeeAlso; |
---|
11 | |
---|
12 | @XmlAccessorType(XmlAccessType.FIELD) |
---|
13 | @XmlSeeAlso( { ComponentDescription.class, ProfileDescription.class }) |
---|
14 | public abstract class AbstractDescription { |
---|
15 | |
---|
16 | public final static DateFormat DATE_FORMAT = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss zzz", Locale.UK); |
---|
17 | |
---|
18 | private String id; |
---|
19 | private String description; |
---|
20 | private String name; |
---|
21 | private String registrationDate; |
---|
22 | private String creatorName; |
---|
23 | @XmlElement(namespace = "http://www.w3.org/1999/xlink") |
---|
24 | private String href; |
---|
25 | |
---|
26 | public void setId(String id) { |
---|
27 | this.id = id; |
---|
28 | } |
---|
29 | |
---|
30 | public String getId() { |
---|
31 | return id; |
---|
32 | } |
---|
33 | |
---|
34 | public void setDescription(String description) { |
---|
35 | this.description = description; |
---|
36 | } |
---|
37 | |
---|
38 | public String getDescription() { |
---|
39 | return description; |
---|
40 | } |
---|
41 | |
---|
42 | public void setName(String name) { |
---|
43 | this.name = name; |
---|
44 | } |
---|
45 | |
---|
46 | public String getName() { |
---|
47 | return name; |
---|
48 | } |
---|
49 | |
---|
50 | public void setRegistrationDate(String registrationDate) { |
---|
51 | this.registrationDate = registrationDate; |
---|
52 | } |
---|
53 | |
---|
54 | public String getRegistrationDate() { |
---|
55 | return registrationDate; |
---|
56 | } |
---|
57 | |
---|
58 | public void setCreatorName(String creatorName) { |
---|
59 | this.creatorName = creatorName; |
---|
60 | } |
---|
61 | |
---|
62 | public String getCreatorName() { |
---|
63 | return creatorName; |
---|
64 | } |
---|
65 | |
---|
66 | public void setHref(String href) { |
---|
67 | this.href = href; |
---|
68 | } |
---|
69 | |
---|
70 | public String getHref() { |
---|
71 | return href; |
---|
72 | } |
---|
73 | |
---|
74 | @Override |
---|
75 | public String toString() { |
---|
76 | return "Name=" + getName() + ", id=" + getId() + ", creatorName=" + getCreatorName(); |
---|
77 | } |
---|
78 | |
---|
79 | public boolean isProfile() { |
---|
80 | return this instanceof ProfileDescription; |
---|
81 | } |
---|
82 | |
---|
83 | } |
---|