IptcRecordSet

Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.CustomPackage

public final class IptcRecordSet extends CustomPackage

Represents a collection of IPTC records.

Learn more

This code sample shows hot to update basic IPTC metadata properties.

try (Metadata metadata = new Metadata(Constants.InputJpeg)) { IIptc root = (IIptc) metadata.getRootPackage(); // Set the IPTC package if it’s missing if (root.getIptcPackage() == null) { root.setIptcPackage(new IptcRecordSet()); } if (root.getIptcPackage().getEnvelopeRecord() == null) { root.getIptcPackage().setEnvelopeRecord(new IptcEnvelopeRecord()); } root.getIptcPackage().getEnvelopeRecord().setDateSent(new Date()); root.getIptcPackage().getEnvelopeRecord().setProductID(“test project id”); // … if (root.getIptcPackage().getApplicationRecord() == null) { root.getIptcPackage().setApplicationRecord(new IptcApplicationRecord()); } root.getIptcPackage().getApplicationRecord().setByLine(“GroupDocs”); root.getIptcPackage().getApplicationRecord().setHeadline(“test”); root.getIptcPackage().getApplicationRecord().setByLineTitle(“code sample”); root.getIptcPackage().getApplicationRecord().setReleaseDate(new Date()); // … metadata.save(Constants.OutputJpeg); }

Constructors

Constructor Description
IptcRecordSet() Initializes a new instance of the IptcRecordSet class.
IptcRecordSet(IptcDataSet[] dataSets) Initializes a new instance of the IptcRecordSet class.

Methods

Method Description
getEnvelopeRecord() Gets the Envelope Record.
setEnvelopeRecord(IptcEnvelopeRecord value) Sets the Envelope Record.
getApplicationRecord() Gets the Application Record.
setApplicationRecord(IptcApplicationRecord value) Sets the Application Record.
get_Item(byte recordNumber) Gets the IptcRecord with the specified number.
get_Item(byte recordNumber, byte dataSetNumber) Gets the IptcDataSet with the specified record and dataSet number.
set(IptcDataSet dataSet) Adds or updates the specified dataSet in the appropriate record.
add(IptcDataSet dataSet) Adds the specified dataSet to the appropriate record.
remove(byte recordNumber, byte dataSetNumber) Removes the dataSet with the specified record and dataSet number.
clear() Removes all records from the collection.
remove(byte recordNumber) Removes the record with the specified record number.
toDataSetList() Creates a list of dataSets from the package.
toList() Creates a list from the package.

IptcRecordSet()

public IptcRecordSet()

Initializes a new instance of the IptcRecordSet class.

IptcRecordSet(IptcDataSet[] dataSets)

public IptcRecordSet(IptcDataSet[] dataSets)

Initializes a new instance of the IptcRecordSet class.

Parameters:

Parameter Type Description
dataSets IptcDataSet[] An array of IPTC dataSets.

getEnvelopeRecord()

public final IptcEnvelopeRecord getEnvelopeRecord()

Gets the Envelope Record.

Returns: IptcEnvelopeRecord - The Envelope Record.

setEnvelopeRecord(IptcEnvelopeRecord value)

public final void setEnvelopeRecord(IptcEnvelopeRecord value)

Sets the Envelope Record.

Parameters:

Parameter Type Description
value IptcEnvelopeRecord The Envelope Record.

getApplicationRecord()

public final IptcApplicationRecord getApplicationRecord()

Gets the Application Record.

Returns: IptcApplicationRecord - The Application Record.

setApplicationRecord(IptcApplicationRecord value)

public final void setApplicationRecord(IptcApplicationRecord value)

Sets the Application Record.

Parameters:

Parameter Type Description
value IptcApplicationRecord The Application Record.

get_Item(byte recordNumber)

public final IptcRecord get_Item(byte recordNumber)

Gets the IptcRecord with the specified number.

Parameters:

Parameter Type Description
recordNumber byte The record number.

Returns: IptcRecord - The IptcRecord with the specified number, if found; otherwise null.

get_Item(byte recordNumber, byte dataSetNumber)

public final IptcDataSet get_Item(byte recordNumber, byte dataSetNumber)

Gets the IptcDataSet with the specified record and dataSet number.

Parameters:

Parameter Type Description
recordNumber byte The record number.
dataSetNumber byte The dataSet number.

Returns: IptcDataSet - The IptcDataSet with the specified record and dataSet number.

set(IptcDataSet dataSet)

public final void set(IptcDataSet dataSet)

Adds or updates the specified dataSet in the appropriate record.

Parameters:

Parameter Type Description
dataSet IptcDataSet The IPTC dataSet to add/update.

add(IptcDataSet dataSet)

public final void add(IptcDataSet dataSet)

Adds the specified dataSet to the appropriate record. The dataSet is considered as repeatable if a dataSet with the specified number already exists.

Parameters:

Parameter Type Description
dataSet IptcDataSet The IPTC dataSet to add.

remove(byte recordNumber, byte dataSetNumber)

public final boolean remove(byte recordNumber, byte dataSetNumber)

Removes the dataSet with the specified record and dataSet number.

Parameters:

Parameter Type Description
recordNumber byte The record number.
dataSetNumber byte The dataSet number.

Returns: boolean - True if the specified IPTC dataSet is found and removed; otherwise, false.

clear()

public final void clear()

Removes all records from the collection.

remove(byte recordNumber)

public final boolean remove(byte recordNumber)

Removes the record with the specified record number.

Parameters:

Parameter Type Description
recordNumber byte The record number.

Returns: boolean - True if the specified IPTC record is found and removed; otherwise, false.

toDataSetList()

public final IReadOnlyList<IptcDataSet> toDataSetList()

Creates a list of dataSets from the package.

Returns: IReadOnlyList - A list that contains all IPTC dataSets from the package.

toList()

public final IReadOnlyList<IptcRecord> toList()

Creates a list from the package.

Returns: IReadOnlyList - A list that contains all IPTC records from the package.