Author: tilman
Date: Sat Dec 13 10:35:06 2025
New Revision: 1930491
Log:
PDFBOX-6121: avoid ClassCastException elsewhere
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/AdobePDFSchema.java
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/ExifSchema.java
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PDFAExtensionSchema.java
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PhotoshopSchema.java
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/TiffSchema.java
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPBasicSchema.java
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPMediaManagementSchema.java
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPRightsManagementSchema.java
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/AdobePDFSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/AdobePDFSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/AdobePDFSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -80,8 +80,7 @@ public class AdobePDFSchema extends XMPS
*/
public void setKeywords(String value)
{
- TextType keywords;
- keywords = createTextType(KEYWORDS, value);
+ TextType keywords = createTextType(KEYWORDS, value);
addProperty(keywords);
}
@@ -104,8 +103,7 @@ public class AdobePDFSchema extends XMPS
*/
public void setPDFVersion(String value)
{
- TextType version;
- version = createTextType(PDF_VERSION, value);
+ TextType version = createTextType(PDF_VERSION, value);
addProperty(version);
}
@@ -129,8 +127,7 @@ public class AdobePDFSchema extends XMPS
*/
public void setProducer(String value)
{
- TextType producer;
- producer = createTextType(PRODUCER, value);
+ TextType producer = createTextType(PRODUCER, value);
addProperty(producer);
}
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/ExifSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/ExifSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/ExifSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -294,7 +294,7 @@ public class ExifSchema extends XMPSchem
*/
public ArrayProperty getUserCommentProperty()
{
- return (ArrayProperty) getProperty(USER_COMMENT);
+ return getPropertyAs(USER_COMMENT, ArrayProperty.class);
}
/**
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PDFAExtensionSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PDFAExtensionSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PDFAExtensionSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -63,7 +63,7 @@ public class PDFAExtensionSchema extends
*/
public ArrayProperty getSchemasProperty()
{
- return (ArrayProperty) getProperty(SCHEMAS);
+ return getPropertyAs(SCHEMAS, ArrayProperty.class);
}
}
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PhotoshopSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PhotoshopSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/PhotoshopSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -117,12 +117,12 @@ public class PhotoshopSchema extends XMP
public URIType getAncestorIDProperty()
{
- return (URIType) getProperty(ANCESTORID);
+ return getPropertyAs(ANCESTORID, URIType.class);
}
public String getAncestorID()
{
- TextType tt = ((TextType) getProperty(ANCESTORID));
+ TextType tt = getAncestorIDProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -139,12 +139,12 @@ public class PhotoshopSchema extends XMP
public TextType getAuthorsPositionProperty()
{
- return (TextType) getProperty(AUTHORS_POSITION);
+ return getPropertyAs(AUTHORS_POSITION, TextType.class);
}
public String getAuthorsPosition()
{
- TextType tt = ((TextType) getProperty(AUTHORS_POSITION));
+ TextType tt = getAuthorsPositionProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -161,12 +161,12 @@ public class PhotoshopSchema extends XMP
public TextType getCaptionWriterProperty()
{
- return (TextType) getProperty(CAPTION_WRITER);
+ return getPropertyAs(CAPTION_WRITER, TextType.class);
}
public String getCaptionWriter()
{
- TextType tt = ((TextType) getProperty(CAPTION_WRITER));
+ TextType tt = getCaptionWriterProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -183,12 +183,12 @@ public class PhotoshopSchema extends XMP
public TextType getCategoryProperty()
{
- return (TextType) getProperty(CATEGORY);
+ return getPropertyAs(CATEGORY, TextType.class);
}
public String getCategory()
{
- TextType tt = ((TextType) getProperty(CATEGORY));
+ TextType tt = getCategoryProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -205,12 +205,12 @@ public class PhotoshopSchema extends XMP
public TextType getCityProperty()
{
- return (TextType) getProperty(CITY);
+ return getPropertyAs(CITY, TextType.class);
}
public String getCity()
{
- TextType tt = ((TextType) getProperty(CITY));
+ TextType tt = getCityProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -227,12 +227,12 @@ public class PhotoshopSchema extends XMP
public IntegerType getColorModeProperty()
{
- return (IntegerType) getProperty(COLOR_MODE);
+ return getPropertyAs(COLOR_MODE, IntegerType.class);
}
public Integer getColorMode()
{
- IntegerType tt = ((IntegerType) getProperty(COLOR_MODE));
+ IntegerType tt = getColorModeProperty();
return tt == null ? null : tt.getValue();
}
@@ -249,12 +249,12 @@ public class PhotoshopSchema extends XMP
public TextType getCountryProperty()
{
- return (TextType) getProperty(COUNTRY);
+ return getPropertyAs(COUNTRY, TextType.class);
}
public String getCountry()
{
- TextType tt = ((TextType) getProperty(COUNTRY));
+ TextType tt = getCountryProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -271,12 +271,12 @@ public class PhotoshopSchema extends XMP
public TextType getCreditProperty()
{
- return (TextType) getProperty(CREDIT);
+ return getPropertyAs(CREDIT, TextType.class);
}
public String getCredit()
{
- TextType tt = ((TextType) getProperty(CREDIT));
+ TextType tt = getCreditProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -293,7 +293,7 @@ public class PhotoshopSchema extends XMP
public DateType getDateCreatedProperty()
{
- return (DateType) getProperty(DATE_CREATED);
+ return getPropertyAs(DATE_CREATED, DateType.class);
}
public String getDateCreated()
@@ -320,7 +320,7 @@ public class PhotoshopSchema extends XMP
public ArrayProperty getDocumentAncestorsProperty()
{
- return (ArrayProperty) getProperty(DOCUMENT_ANCESTORS);
+ return getPropertyAs(DOCUMENT_ANCESTORS, ArrayProperty.class);
}
public List<String> getDocumentAncestors()
@@ -330,12 +330,12 @@ public class PhotoshopSchema extends XMP
public TextType getHeadlineProperty()
{
- return (TextType) getProperty(HEADLINE);
+ return getPropertyAs(HEADLINE, TextType.class);
}
public String getHeadline()
{
- TextType tt = ((TextType) getProperty(HEADLINE));
+ TextType tt = getHeadlineProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -352,12 +352,12 @@ public class PhotoshopSchema extends XMP
public TextType getHistoryProperty()
{
- return (TextType) getProperty(HISTORY);
+ return getPropertyAs(HISTORY, TextType.class);
}
public String getHistory()
{
- TextType tt = ((TextType) getProperty(HISTORY));
+ TextType tt = getHistoryProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -374,12 +374,12 @@ public class PhotoshopSchema extends XMP
public TextType getICCProfileProperty()
{
- return (TextType) getProperty(ICC_PROFILE);
+ return getPropertyAs(ICC_PROFILE, TextType.class);
}
public String getICCProfile()
{
- TextType tt = ((TextType) getProperty(ICC_PROFILE));
+ TextType tt = getICCProfileProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -396,12 +396,12 @@ public class PhotoshopSchema extends XMP
public TextType getInstructionsProperty()
{
- return (TextType) getProperty(INSTRUCTIONS);
+ return getPropertyAs(INSTRUCTIONS, TextType.class);
}
public String getInstructions()
{
- TextType tt = ((TextType) getProperty(INSTRUCTIONS));
+ TextType tt = getInstructionsProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -419,12 +419,12 @@ public class PhotoshopSchema extends XMP
public TextType getSourceProperty()
{
- return (TextType) getProperty(SOURCE);
+ return getPropertyAs(SOURCE, TextType.class);
}
public String getSource()
{
- TextType tt = ((TextType) getProperty(SOURCE));
+ TextType tt = getSourceProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -441,12 +441,12 @@ public class PhotoshopSchema extends XMP
public TextType getStateProperty()
{
- return (TextType) getProperty(STATE);
+ return getPropertyAs(STATE, TextType.class);
}
public String getState()
{
- TextType tt = ((TextType) getProperty(STATE));
+ TextType tt = getStateProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -463,12 +463,12 @@ public class PhotoshopSchema extends XMP
public TextType getSupplementalCategoriesProperty()
{
- return (TextType) getProperty(SUPPLEMENTAL_CATEGORIES);
+ return getPropertyAs(SUPPLEMENTAL_CATEGORIES, TextType.class);
}
public String getSupplementalCategories()
{
- TextType tt = ((TextType) getProperty(SUPPLEMENTAL_CATEGORIES));
+ TextType tt = getSupplementalCategoriesProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -522,12 +522,12 @@ public class PhotoshopSchema extends XMP
public TextType getTransmissionReferenceProperty()
{
- return (TextType) getProperty(TRANSMISSION_REFERENCE);
+ return getPropertyAs(TRANSMISSION_REFERENCE, TextType.class);
}
public String getTransmissionReference()
{
- TextType tt = ((TextType) getProperty(TRANSMISSION_REFERENCE));
+ TextType tt = getTransmissionReferenceProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -544,12 +544,12 @@ public class PhotoshopSchema extends XMP
public IntegerType getUrgencyProperty()
{
- return (IntegerType) getProperty(URGENCY);
+ return getPropertyAs(URGENCY, IntegerType.class);
}
public Integer getUrgency()
{
- IntegerType tt = ((IntegerType) getProperty(URGENCY));
+ IntegerType tt = getUrgencyProperty();
return tt == null ? null : tt.getValue();
}
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/TiffSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/TiffSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/TiffSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -125,7 +125,7 @@ public class TiffSchema extends XMPSchem
*/
public ProperNameType getArtistProperty()
{
- return (ProperNameType) getProperty(ARTIST);
+ return getPropertyAs(ARTIST, ProperNameType.class);
}
/**
@@ -134,7 +134,7 @@ public class TiffSchema extends XMPSchem
*/
public String getArtist()
{
- ProperNameType tt = (ProperNameType) getProperty(ARTIST);
+ ProperNameType tt = getArtistProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -154,7 +154,7 @@ public class TiffSchema extends XMPSchem
*/
public ArrayProperty getImageDescriptionProperty()
{
- return (ArrayProperty) getProperty(IMAGE_DESCRIPTION);
+ return getPropertyAs(IMAGE_DESCRIPTION, ArrayProperty.class);
}
/**
@@ -202,7 +202,7 @@ public class TiffSchema extends XMPSchem
*/
public ArrayProperty getCopyRightProperty()
{
- return (ArrayProperty) getProperty(COPYRIGHT);
+ return getPropertyAs(COPYRIGHT, ArrayProperty.class);
}
/**
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPBasicSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPBasicSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPBasicSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -378,7 +378,7 @@ public class XMPBasicSchema extends XMPS
*/
public ArrayProperty getAdvisoryProperty()
{
- return (ArrayProperty) getProperty(ADVISORY);
+ return getPropertyAs(ADVISORY, ArrayProperty.class);
}
/**
@@ -398,7 +398,7 @@ public class XMPBasicSchema extends XMPS
*/
public TextType getBaseURLProperty()
{
- return (TextType) getProperty(BASEURL);
+ return getPropertyAs(BASEURL, TextType.class);
}
/**
@@ -408,7 +408,7 @@ public class XMPBasicSchema extends XMPS
*/
public String getBaseURL()
{
- TextType tt = ((TextType) getProperty(BASEURL));
+ TextType tt = getBaseURLProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -419,7 +419,7 @@ public class XMPBasicSchema extends XMPS
*/
public DateType getCreateDateProperty()
{
- return (DateType) getProperty(CREATEDATE);
+ return getPropertyAs(CREATEDATE, DateType.class);
}
/**
@@ -429,7 +429,7 @@ public class XMPBasicSchema extends XMPS
*/
public Calendar getCreateDate()
{
- DateType createDate = (DateType) getProperty(CREATEDATE);
+ DateType createDate = getCreateDateProperty();
if (createDate != null)
{
return createDate.getValue();
@@ -444,7 +444,7 @@ public class XMPBasicSchema extends XMPS
*/
public TextType getCreatorToolProperty()
{
- return (TextType) getProperty(CREATORTOOL);
+ return getPropertyAs(CREATORTOOL, TextType.class);
}
/**
@@ -454,7 +454,7 @@ public class XMPBasicSchema extends XMPS
*/
public String getCreatorTool()
{
- TextType tt = ((TextType) getProperty(CREATORTOOL));
+ TextType tt = getCreatorToolProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -465,7 +465,7 @@ public class XMPBasicSchema extends XMPS
*/
public ArrayProperty getIdentifiersProperty()
{
- return (ArrayProperty) getProperty(IDENTIFIER);
+ return getPropertyAs(IDENTIFIER, ArrayProperty.class);
}
/**
@@ -485,7 +485,7 @@ public class XMPBasicSchema extends XMPS
*/
public TextType getLabelProperty()
{
- return (TextType) getProperty(LABEL);
+ return getPropertyAs(LABEL, TextType.class);
}
/**
@@ -495,7 +495,7 @@ public class XMPBasicSchema extends XMPS
*/
public String getLabel()
{
- TextType tt = ((TextType) getProperty(LABEL));
+ TextType tt = getLabelProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -506,7 +506,7 @@ public class XMPBasicSchema extends XMPS
*/
public DateType getMetadataDateProperty()
{
- return (DateType) getProperty(METADATADATE);
+ return getPropertyAs(METADATADATE, DateType.class);
}
/**
@@ -514,9 +514,9 @@ public class XMPBasicSchema extends XMPS
*
* @return the MetadataDate value
*/
- public Calendar getMetadataDate()
+ public Calendar getMetadataDate()
{
- DateType dt = ((DateType) getProperty(METADATADATE));
+ DateType dt = getMetadataDateProperty();
return dt == null ? null : dt.getValue();
}
@@ -527,12 +527,12 @@ public class XMPBasicSchema extends XMPS
*/
public DateType getModifyDateProperty()
{
- return (DateType) getProperty(MODIFYDATE);
+ return getPropertyAs(MODIFYDATE, DateType.class);
}
public DateType getModifierDateProperty()
{
- return (DateType) getProperty(MODIFIER_DATE);
+ return getPropertyAs(MODIFIER_DATE, DateType.class);
}
/**
@@ -542,7 +542,7 @@ public class XMPBasicSchema extends XMPS
*/
public Calendar getModifyDate()
{
- DateType modifyDate = (DateType) getProperty(MODIFYDATE);
+ DateType modifyDate = getModifyDateProperty();
if (modifyDate != null)
{
return modifyDate.getValue();
@@ -553,7 +553,7 @@ public class XMPBasicSchema extends XMPS
public Calendar getModifierDate()
{
- DateType modifierDate = (DateType) getProperty(MODIFIER_DATE);
+ DateType modifierDate = getModifierDateProperty();
if (modifierDate != null)
{
return modifierDate.getValue();
@@ -569,7 +569,7 @@ public class XMPBasicSchema extends XMPS
*/
public TextType getNicknameProperty()
{
- return (TextType) getProperty(NICKNAME);
+ return getPropertyAs(NICKNAME, TextType.class);
}
/**
@@ -579,7 +579,7 @@ public class XMPBasicSchema extends XMPS
*/
public String getNickname()
{
- TextType tt = ((TextType) getProperty(NICKNAME));
+ TextType tt = getNicknameProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -590,7 +590,7 @@ public class XMPBasicSchema extends XMPS
*/
public IntegerType getRatingProperty()
{
- return ((IntegerType) getProperty(RATING));
+ return getPropertyAs(RATING, IntegerType.class);
}
/**
@@ -600,7 +600,7 @@ public class XMPBasicSchema extends XMPS
*/
public Integer getRating()
{
- IntegerType it = ((IntegerType) getProperty(RATING));
+ IntegerType it = getRatingProperty();
return it == null ? null : it.getValue();
}
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPMediaManagementSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPMediaManagementSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPMediaManagementSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -117,7 +117,7 @@ public class XMPMediaManagementSchema ex
*/
public ResourceRefType getDerivedFromProperty()
{
- return (ResourceRefType) getProperty(DERIVED_FROM);
+ return getPropertyAs(DERIVED_FROM, ResourceRefType.class);
}
// --------------------------------------- DocumentID
@@ -158,7 +158,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getDocumentIDProperty()
{
- return (TextType) getProperty(DOCUMENTID);
+ return getPropertyAs(DOCUMENTID, TextType.class);
}
/**
@@ -204,7 +204,7 @@ public class XMPMediaManagementSchema ex
*/
public URLType getLastURLProperty()
{
- return (URLType) getProperty(LAST_URL);
+ return getPropertyAs(LAST_URL, URLType.class);
}
/**
@@ -250,7 +250,7 @@ public class XMPMediaManagementSchema ex
*/
public IntegerType getSaveIDProperty()
{
- return (IntegerType) getProperty(SAVE_ID);
+ return getPropertyAs(SAVE_ID, IntegerType.class);
}
/**
@@ -300,7 +300,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getManagerProperty()
{
- return (TextType) getProperty(MANAGER);
+ return getPropertyAs(MANAGER, TextType.class);
}
/**
@@ -350,7 +350,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getManageToProperty()
{
- return (TextType) getProperty(MANAGETO);
+ return getPropertyAs(MANAGETO, TextType.class);
}
/**
@@ -400,7 +400,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getManageUIProperty()
{
- return (TextType) getProperty(MANAGEUI);
+ return getPropertyAs(MANAGEUI, TextType.class);
}
/**
@@ -450,7 +450,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getManagerVariantProperty()
{
- return (TextType) getProperty(MANAGERVARIANT);
+ return getPropertyAs(MANAGERVARIANT, TextType.class);
}
/**
@@ -500,7 +500,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getInstanceIDProperty()
{
- return (TextType) getProperty(INSTANCEID);
+ return getPropertyAs(INSTANCEID, TextType.class);
}
/**
@@ -537,7 +537,7 @@ public class XMPMediaManagementSchema ex
*/
public ResourceRefType getManagedFromProperty()
{
- return (ResourceRefType) getProperty(MANAGED_FROM);
+ return getPropertyAs(MANAGED_FROM, ResourceRefType.class);
}
// --------------------------------------- OriginalDocumentID
@@ -576,7 +576,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getOriginalDocumentIDProperty()
{
- return (TextType) getProperty(ORIGINALDOCUMENTID);
+ return getPropertyAs(ORIGINALDOCUMENTID, TextType.class);
}
/**
@@ -626,7 +626,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getRenditionClassProperty()
{
- return (TextType) getProperty(RENDITIONCLASS);
+ return getPropertyAs(RENDITIONCLASS, TextType.class);
}
/**
@@ -676,7 +676,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getRenditionParamsProperty()
{
- return (TextType) getProperty(RENDITIONPARAMS);
+ return getPropertyAs(RENDITIONPARAMS, TextType.class);
}
/**
@@ -726,7 +726,7 @@ public class XMPMediaManagementSchema ex
*/
public TextType getVersionIDProperty()
{
- return (TextType) getProperty(VERSIONID);
+ return getPropertyAs(VERSIONID, TextType.class);
}
/**
@@ -758,7 +758,7 @@ public class XMPMediaManagementSchema ex
*/
public ArrayProperty getVersionsProperty()
{
- return (ArrayProperty) getProperty(VERSIONS);
+ return getPropertyAs(VERSIONS, ArrayProperty.class);
}
public List<String> getVersions()
@@ -790,7 +790,7 @@ public class XMPMediaManagementSchema ex
*/
public ArrayProperty getHistoryProperty()
{
- return (ArrayProperty) getProperty(HISTORY);
+ return getPropertyAs(HISTORY, ArrayProperty.class);
}
/**
@@ -830,7 +830,7 @@ public class XMPMediaManagementSchema ex
*/
public ArrayProperty getIngredientsProperty()
{
- return (ArrayProperty) getProperty(INGREDIENTS);
+ return getPropertyAs(INGREDIENTS, ArrayProperty.class);
}
/**
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPRightsManagementSchema.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPRightsManagementSchema.java
Sat Dec 13 09:52:52 2025 (r1930490)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPRightsManagementSchema.java
Sat Dec 13 10:35:06 2025 (r1930491)
@@ -105,7 +105,7 @@ public class XMPRightsManagementSchema e
*/
public ArrayProperty getOwnersProperty()
{
- return (ArrayProperty) getProperty(OWNER);
+ return getPropertyAs(OWNER, ArrayProperty.class);
}
/**
@@ -148,7 +148,7 @@ public class XMPRightsManagementSchema e
*/
public BooleanType getMarkedProperty()
{
- return (BooleanType) getProperty(MARKED);
+ return getPropertyAs(MARKED, BooleanType.class);
}
/**
@@ -158,7 +158,7 @@ public class XMPRightsManagementSchema e
*/
public Boolean getMarked()
{
- BooleanType bt = ((BooleanType) getProperty(MARKED));
+ BooleanType bt = getMarkedProperty();
return bt == null ? null : bt.getValue();
}
@@ -193,7 +193,7 @@ public class XMPRightsManagementSchema e
*/
public ArrayProperty getUsageTermsProperty()
{
- return (ArrayProperty) getProperty(USAGETERMS);
+ return getPropertyAs(USAGETERMS, ArrayProperty.class);
}
/**
@@ -235,7 +235,7 @@ public class XMPRightsManagementSchema e
*/
public TextType getWebStatementProperty()
{
- return ((TextType) getProperty(WEBSTATEMENT));
+ return getPropertyAs(WEBSTATEMENT, TextType.class);
}
/**
@@ -245,7 +245,7 @@ public class XMPRightsManagementSchema e
*/
public String getWebStatement()
{
- TextType tt = ((TextType) getProperty(WEBSTATEMENT));
+ TextType tt = getWebStatementProperty();
return tt == null ? null : tt.getStringValue();
}
@@ -279,7 +279,7 @@ public class XMPRightsManagementSchema e
*/
public TextType getCertificateProperty()
{
- return ((TextType) getProperty(CERTIFICATE));
+ return getPropertyAs(CERTIFICATE, TextType.class);
}
/**
@@ -289,7 +289,7 @@ public class XMPRightsManagementSchema e
*/
public String getCertificate()
{
- TextType tt = ((TextType) getProperty(CERTIFICATE));
+ TextType tt = getCertificateProperty();
return tt == null ? null : tt.getStringValue();
}