IptcRecordSet
Leave feedback
On this page
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); }
| Constructor | Description |
|---|---|
| IptcRecordSet() | Initializes a new instance of the IptcRecordSet class. |
| IptcRecordSet(IptcDataSet[] dataSets) | Initializes a new instance of the IptcRecordSet class. |
| 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. |
public IptcRecordSet()
Initializes a new instance of the IptcRecordSet class.
public IptcRecordSet(IptcDataSet[] dataSets)
Initializes a new instance of the IptcRecordSet class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| dataSets | IptcDataSet[] | An array of IPTC dataSets. |
public final IptcEnvelopeRecord getEnvelopeRecord()
Gets the Envelope Record.
Returns: IptcEnvelopeRecord - The Envelope Record.
public final void setEnvelopeRecord(IptcEnvelopeRecord value)
Sets the Envelope Record.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | IptcEnvelopeRecord | The Envelope Record. |
public final IptcApplicationRecord getApplicationRecord()
Gets the Application Record.
Returns: IptcApplicationRecord - The Application Record.
public final void setApplicationRecord(IptcApplicationRecord value)
Sets the Application Record.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | IptcApplicationRecord | The Application Record. |
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.
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.
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. |
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. |
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.
public final void clear()
Removes all records from the collection.
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.
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.
public final IReadOnlyList<IptcRecord> toList()
Creates a list from the package.
Returns: IReadOnlyList - A list that contains all IPTC records from the package.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.