@@ -117,12 +117,12 @@ public PhotoshopSchema(XMPMetadata metadata, String ownPrefix)
117117
118118 public URIType getAncestorIDProperty ()
119119 {
120- return ( URIType ) getProperty ( ANCESTORID );
120+ return getPropertyAs ( ANCESTORID , URIType . class );
121121 }
122122
123123 public String getAncestorID ()
124124 {
125- TextType tt = (( TextType ) getProperty ( ANCESTORID ) );
125+ TextType tt = getAncestorIDProperty ( );
126126 return tt == null ? null : tt .getStringValue ();
127127 }
128128
@@ -139,12 +139,12 @@ public void setAncestorIDProperty(URIType text)
139139
140140 public TextType getAuthorsPositionProperty ()
141141 {
142- return ( TextType ) getProperty ( AUTHORS_POSITION );
142+ return getPropertyAs ( AUTHORS_POSITION , TextType . class );
143143 }
144144
145145 public String getAuthorsPosition ()
146146 {
147- TextType tt = (( TextType ) getProperty ( AUTHORS_POSITION ) );
147+ TextType tt = getAuthorsPositionProperty ( );
148148 return tt == null ? null : tt .getStringValue ();
149149 }
150150
@@ -161,12 +161,12 @@ public void setAuthorsPositionProperty(TextType text)
161161
162162 public TextType getCaptionWriterProperty ()
163163 {
164- return ( TextType ) getProperty ( CAPTION_WRITER );
164+ return getPropertyAs ( CAPTION_WRITER , TextType . class );
165165 }
166166
167167 public String getCaptionWriter ()
168168 {
169- TextType tt = (( TextType ) getProperty ( CAPTION_WRITER ) );
169+ TextType tt = getCaptionWriterProperty ( );
170170 return tt == null ? null : tt .getStringValue ();
171171 }
172172
@@ -183,12 +183,12 @@ public void setCaptionWriterProperty(ProperNameType text)
183183
184184 public TextType getCategoryProperty ()
185185 {
186- return ( TextType ) getProperty ( CATEGORY );
186+ return getPropertyAs ( CATEGORY , TextType . class );
187187 }
188188
189189 public String getCategory ()
190190 {
191- TextType tt = (( TextType ) getProperty ( CATEGORY ) );
191+ TextType tt = getCategoryProperty ( );
192192 return tt == null ? null : tt .getStringValue ();
193193 }
194194
@@ -205,12 +205,12 @@ public void setCategoryProperty(TextType text)
205205
206206 public TextType getCityProperty ()
207207 {
208- return ( TextType ) getProperty ( CITY );
208+ return getPropertyAs ( CITY , TextType . class );
209209 }
210210
211211 public String getCity ()
212212 {
213- TextType tt = (( TextType ) getProperty ( CITY ) );
213+ TextType tt = getCityProperty ( );
214214 return tt == null ? null : tt .getStringValue ();
215215 }
216216
@@ -227,12 +227,12 @@ public void setCityProperty(TextType text)
227227
228228 public IntegerType getColorModeProperty ()
229229 {
230- return ( IntegerType ) getProperty ( COLOR_MODE );
230+ return getPropertyAs ( COLOR_MODE , IntegerType . class );
231231 }
232232
233233 public Integer getColorMode ()
234234 {
235- IntegerType tt = (( IntegerType ) getProperty ( COLOR_MODE ) );
235+ IntegerType tt = getColorModeProperty ( );
236236 return tt == null ? null : tt .getValue ();
237237 }
238238
@@ -249,12 +249,12 @@ public void setColorModeProperty(IntegerType text)
249249
250250 public TextType getCountryProperty ()
251251 {
252- return ( TextType ) getProperty ( COUNTRY );
252+ return getPropertyAs ( COUNTRY , TextType . class );
253253 }
254254
255255 public String getCountry ()
256256 {
257- TextType tt = (( TextType ) getProperty ( COUNTRY ) );
257+ TextType tt = getCountryProperty ( );
258258 return tt == null ? null : tt .getStringValue ();
259259 }
260260
@@ -271,12 +271,12 @@ public void setCountryProperty(TextType text)
271271
272272 public TextType getCreditProperty ()
273273 {
274- return ( TextType ) getProperty ( CREDIT );
274+ return getPropertyAs ( CREDIT , TextType . class );
275275 }
276276
277277 public String getCredit ()
278278 {
279- TextType tt = (( TextType ) getProperty ( CREDIT ) );
279+ TextType tt = getCreditProperty ( );
280280 return tt == null ? null : tt .getStringValue ();
281281 }
282282
@@ -293,12 +293,12 @@ public void setCreditProperty(TextType text)
293293
294294 public DateType getDateCreatedProperty ()
295295 {
296- return ( DateType ) getProperty ( DATE_CREATED );
296+ return getPropertyAs ( DATE_CREATED , DateType . class );
297297 }
298298
299299 public String getDateCreated ()
300300 {
301- TextType tt = ((TextType ) getProperty (DATE_CREATED ));
301+ TextType tt = ((TextType ) getProperty (DATE_CREATED )); //TODO cast looks highly suspicious
302302 return tt == null ? null : tt .getStringValue ();
303303 }
304304
@@ -320,7 +320,7 @@ public void addDocumentAncestors(String text)
320320
321321 public ArrayProperty getDocumentAncestorsProperty ()
322322 {
323- return ( ArrayProperty ) getProperty ( DOCUMENT_ANCESTORS );
323+ return getPropertyAs ( DOCUMENT_ANCESTORS , ArrayProperty . class );
324324 }
325325
326326 public List <String > getDocumentAncestors ()
@@ -330,12 +330,12 @@ public List<String> getDocumentAncestors()
330330
331331 public TextType getHeadlineProperty ()
332332 {
333- return ( TextType ) getProperty ( HEADLINE );
333+ return getPropertyAs ( HEADLINE , TextType . class );
334334 }
335335
336336 public String getHeadline ()
337337 {
338- TextType tt = (( TextType ) getProperty ( HEADLINE ) );
338+ TextType tt = getHeadlineProperty ( );
339339 return tt == null ? null : tt .getStringValue ();
340340 }
341341
@@ -352,12 +352,12 @@ public void setHeadlineProperty(TextType text)
352352
353353 public TextType getHistoryProperty ()
354354 {
355- return ( TextType ) getProperty ( HISTORY );
355+ return getPropertyAs ( HISTORY , TextType . class );
356356 }
357357
358358 public String getHistory ()
359359 {
360- TextType tt = (( TextType ) getProperty ( HISTORY ) );
360+ TextType tt = getHistoryProperty ( );
361361 return tt == null ? null : tt .getStringValue ();
362362 }
363363
@@ -374,12 +374,12 @@ public void setHistoryProperty(TextType text)
374374
375375 public TextType getICCProfileProperty ()
376376 {
377- return ( TextType ) getProperty ( ICC_PROFILE );
377+ return getPropertyAs ( ICC_PROFILE , TextType . class );
378378 }
379379
380380 public String getICCProfile ()
381381 {
382- TextType tt = (( TextType ) getProperty ( ICC_PROFILE ) );
382+ TextType tt = getICCProfileProperty ( );
383383 return tt == null ? null : tt .getStringValue ();
384384 }
385385
@@ -396,12 +396,12 @@ public void setICCProfileProperty(TextType text)
396396
397397 public TextType getInstructionsProperty ()
398398 {
399- return ( TextType ) getProperty ( INSTRUCTIONS );
399+ return getPropertyAs ( INSTRUCTIONS , TextType . class );
400400 }
401401
402402 public String getInstructions ()
403403 {
404- TextType tt = (( TextType ) getProperty ( INSTRUCTIONS ) );
404+ TextType tt = getInstructionsProperty ( );
405405 return tt == null ? null : tt .getStringValue ();
406406 }
407407
@@ -419,12 +419,12 @@ public void setInstructionsProperty(TextType text)
419419
420420 public TextType getSourceProperty ()
421421 {
422- return ( TextType ) getProperty ( SOURCE );
422+ return getPropertyAs ( SOURCE , TextType . class );
423423 }
424424
425425 public String getSource ()
426426 {
427- TextType tt = (( TextType ) getProperty ( SOURCE ) );
427+ TextType tt = getSourceProperty ( );
428428 return tt == null ? null : tt .getStringValue ();
429429 }
430430
@@ -441,12 +441,12 @@ public void setSourceProperty(TextType text)
441441
442442 public TextType getStateProperty ()
443443 {
444- return ( TextType ) getProperty ( STATE );
444+ return getPropertyAs ( STATE , TextType . class );
445445 }
446446
447447 public String getState ()
448448 {
449- TextType tt = (( TextType ) getProperty ( STATE ) );
449+ TextType tt = getStateProperty ( );
450450 return tt == null ? null : tt .getStringValue ();
451451 }
452452
@@ -463,12 +463,12 @@ public void setStateProperty(TextType text)
463463
464464 public TextType getSupplementalCategoriesProperty ()
465465 {
466- return ( TextType ) getProperty ( SUPPLEMENTAL_CATEGORIES );
466+ return getPropertyAs ( SUPPLEMENTAL_CATEGORIES , TextType . class );
467467 }
468468
469469 public String getSupplementalCategories ()
470470 {
471- TextType tt = (( TextType ) getProperty ( SUPPLEMENTAL_CATEGORIES ) );
471+ TextType tt = getSupplementalCategoriesProperty ( );
472472 return tt == null ? null : tt .getStringValue ();
473473 }
474474
@@ -522,12 +522,12 @@ public List<LayerType> getTextLayers() throws BadFieldValueException
522522
523523 public TextType getTransmissionReferenceProperty ()
524524 {
525- return ( TextType ) getProperty ( TRANSMISSION_REFERENCE );
525+ return getPropertyAs ( TRANSMISSION_REFERENCE , TextType . class );
526526 }
527527
528528 public String getTransmissionReference ()
529529 {
530- TextType tt = (( TextType ) getProperty ( TRANSMISSION_REFERENCE ) );
530+ TextType tt = getTransmissionReferenceProperty ( );
531531 return tt == null ? null : tt .getStringValue ();
532532 }
533533
@@ -544,12 +544,12 @@ public void setTransmissionReferenceProperty(TextType text)
544544
545545 public IntegerType getUrgencyProperty ()
546546 {
547- return ( IntegerType ) getProperty ( URGENCY );
547+ return getPropertyAs ( URGENCY , IntegerType . class );
548548 }
549549
550550 public Integer getUrgency ()
551551 {
552- IntegerType tt = (( IntegerType ) getProperty ( URGENCY ) );
552+ IntegerType tt = getUrgencyProperty ( );
553553 return tt == null ? null : tt .getValue ();
554554 }
555555
0 commit comments