1
2
3
4
5
6
7
8
9 package org.openprovenance.model;
10
11 import java.util.ArrayList;
12 import java.util.List;
13 import javax.xml.bind.JAXBElement;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlAttribute;
17 import javax.xml.bind.annotation.XmlElement;
18 import javax.xml.bind.annotation.XmlElementRef;
19 import javax.xml.bind.annotation.XmlID;
20 import javax.xml.bind.annotation.XmlSchemaType;
21 import javax.xml.bind.annotation.XmlSeeAlso;
22 import javax.xml.bind.annotation.XmlType;
23 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
24 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
25 import org.apache.commons.lang.builder.EqualsBuilder;
26 import org.apache.commons.lang.builder.HashCodeBuilder;
27 import org.apache.commons.lang.builder.ToStringBuilder;
28 import org.jvnet.jaxb2_commons.lang.Equals;
29 import org.jvnet.jaxb2_commons.lang.HashCode;
30 import org.jvnet.jaxb2_commons.lang.ToString;
31 import org.jvnet.jaxb2_commons.lang.builder.JAXBEqualsBuilder;
32 import org.jvnet.jaxb2_commons.lang.builder.JAXBHashCodeBuilder;
33 import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder;
34
35
36 /***
37 * <p>Java class for EmbeddedAnnotation complex type.
38 *
39 * <p>The following schema fragment specifies the expected content contained within this class.
40 *
41 * <pre>
42 * <complexType name="EmbeddedAnnotation">
43 * <complexContent>
44 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
45 * <sequence>
46 * <element name="property" type="{http://openprovenance.org/model/v1.1.a}Property" maxOccurs="unbounded"/>
47 * <element name="account" type="{http://openprovenance.org/model/v1.1.a}AccountRef" maxOccurs="unbounded" minOccurs="0"/>
48 * <element ref="{http://openprovenance.org/model/v1.1.a}annotation" maxOccurs="unbounded" minOccurs="0"/>
49 * </sequence>
50 * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
51 * </restriction>
52 * </complexContent>
53 * </complexType>
54 * </pre>
55 *
56 *
57 */
58 @XmlAccessorType(XmlAccessType.FIELD)
59 @XmlType(name = "EmbeddedAnnotation", namespace = "http://openprovenance.org/model/v1.1.a", propOrder = {
60 "property",
61 "account",
62 "annotation"
63 })
64 @XmlSeeAlso({
65 PName.class,
66 Value.class,
67 Label.class,
68 Type.class,
69 Profile.class,
70 Annotation.class
71 })
72 public class EmbeddedAnnotation implements HasAccounts, Annotable, Equals, HashCode, ToString
73 {
74
75 @XmlElement(namespace = "http://openprovenance.org/model/v1.1.a", required = true)
76 protected List<Property> property;
77 @XmlElement(namespace = "http://openprovenance.org/model/v1.1.a")
78 protected List<AccountRef> account;
79 @XmlElementRef(name = "annotation", namespace = "http://openprovenance.org/model/v1.1.a", type = JAXBElement.class)
80 protected List<JAXBElement<? extends EmbeddedAnnotation>> annotation;
81 @XmlAttribute
82 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
83 @XmlID
84 @XmlSchemaType(name = "ID")
85 protected String id;
86
87 /***
88 * Gets the value of the property property.
89 *
90 * <p>
91 * This accessor method returns a reference to the live list,
92 * not a snapshot. Therefore any modification you make to the
93 * returned list will be present inside the JAXB object.
94 * This is why there is not a <CODE>set</CODE> method for the property property.
95 *
96 * <p>
97 * For example, to add a new item, do as follows:
98 * <pre>
99 * getProperty().add(newItem);
100 * </pre>
101 *
102 *
103 * <p>
104 * Objects of the following type(s) are allowed in the list
105 * {@link Property }
106 *
107 *
108 */
109 public List<Property> getProperty() {
110 if (property == null) {
111 property = new ArrayList<Property>();
112 }
113 return this.property;
114 }
115
116 /***
117 * Gets the value of the account property.
118 *
119 * <p>
120 * This accessor method returns a reference to the live list,
121 * not a snapshot. Therefore any modification you make to the
122 * returned list will be present inside the JAXB object.
123 * This is why there is not a <CODE>set</CODE> method for the account property.
124 *
125 * <p>
126 * For example, to add a new item, do as follows:
127 * <pre>
128 * getAccount().add(newItem);
129 * </pre>
130 *
131 *
132 * <p>
133 * Objects of the following type(s) are allowed in the list
134 * {@link AccountRef }
135 *
136 *
137 */
138 public List<AccountRef> getAccount() {
139 if (account == null) {
140 account = new ArrayList<AccountRef>();
141 }
142 return this.account;
143 }
144
145 /***
146 * Gets the value of the annotation property.
147 *
148 * <p>
149 * This accessor method returns a reference to the live list,
150 * not a snapshot. Therefore any modification you make to the
151 * returned list will be present inside the JAXB object.
152 * This is why there is not a <CODE>set</CODE> method for the annotation property.
153 *
154 * <p>
155 * For example, to add a new item, do as follows:
156 * <pre>
157 * getAnnotation().add(newItem);
158 * </pre>
159 *
160 *
161 * <p>
162 * Objects of the following type(s) are allowed in the list
163 * {@link JAXBElement }{@code <}{@link Type }{@code >}
164 * {@link JAXBElement }{@code <}{@link Label }{@code >}
165 * {@link JAXBElement }{@code <}{@link PName }{@code >}
166 * {@link JAXBElement }{@code <}{@link Profile }{@code >}
167 * {@link JAXBElement }{@code <}{@link EmbeddedAnnotation }{@code >}
168 * {@link JAXBElement }{@code <}{@link Value }{@code >}
169 *
170 *
171 */
172 public List<JAXBElement<? extends EmbeddedAnnotation>> getAnnotation() {
173 if (annotation == null) {
174 annotation = new ArrayList<JAXBElement<? extends EmbeddedAnnotation>>();
175 }
176 return this.annotation;
177 }
178
179 /***
180 * Gets the value of the id property.
181 *
182 * @return
183 * possible object is
184 * {@link String }
185 *
186 */
187 public String getId() {
188 return id;
189 }
190
191 /***
192 * Sets the value of the id property.
193 *
194 * @param value
195 * allowed object is
196 * {@link String }
197 *
198 */
199 public void setId(String value) {
200 this.id = value;
201 }
202
203 public void equals(Object object, EqualsBuilder equalsBuilder) {
204 if (!(object instanceof EmbeddedAnnotation)) {
205 equalsBuilder.appendSuper(false);
206 return ;
207 }
208 if (this == object) {
209 return ;
210 }
211 final EmbeddedAnnotation that = ((EmbeddedAnnotation) object);
212 equalsBuilder.append(this.getProperty(), that.getProperty());
213 equalsBuilder.append(this.getAccount(), that.getAccount());
214 equalsBuilder.append(this.getAnnotation(), that.getAnnotation());
215 equalsBuilder.append(this.getId(), that.getId());
216 }
217
218 public boolean equals(Object object) {
219 if (!(object instanceof EmbeddedAnnotation)) {
220 return false;
221 }
222 if (this == object) {
223 return true;
224 }
225 final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder();
226 equals(object, equalsBuilder);
227 return equalsBuilder.isEquals();
228 }
229
230 public void hashCode(HashCodeBuilder hashCodeBuilder) {
231 hashCodeBuilder.append(this.getProperty());
232 hashCodeBuilder.append(this.getAccount());
233 hashCodeBuilder.append(this.getAnnotation());
234 hashCodeBuilder.append(this.getId());
235 }
236
237 public int hashCode() {
238 final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder();
239 hashCode(hashCodeBuilder);
240 return hashCodeBuilder.toHashCode();
241 }
242
243 public void toString(ToStringBuilder toStringBuilder) {
244 {
245 List<Property> theProperty;
246 theProperty = this.getProperty();
247 toStringBuilder.append("property", theProperty);
248 }
249 {
250 List<AccountRef> theAccount;
251 theAccount = this.getAccount();
252 toStringBuilder.append("account", theAccount);
253 }
254 {
255 List<JAXBElement<? extends EmbeddedAnnotation>> theAnnotation;
256 theAnnotation = this.getAnnotation();
257 toStringBuilder.append("annotation", theAnnotation);
258 }
259 {
260 String theId;
261 theId = this.getId();
262 toStringBuilder.append("id", theId);
263 }
264 }
265
266 public String toString() {
267 final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this);
268 toString(toStringBuilder);
269 return toStringBuilder.toString();
270 }
271
272 }