public class VCardRootPackage extends RootMetadataPackage
Represents the root package allowing working with metadata in a VCard file.
Learn more
This code sample demonstrates how to read metadata properties of a vCard file.
public static void run() { try (Metadata metadata = new Metadata(Constants.InputVcf)) { VCardRootPackage root = metadata.getRootPackageGeneric(); for (VCardCard vCard : root.getVCardPackage().getCards()) { System.out.println(vCard.getIdentificationRecordset().getName()); PrintArray(vCard.getIdentificationRecordset().getFormattedNames()); PrintArray(vCard.getCommunicationRecordset().getEmails()); PrintArray(vCard.getCommunicationRecordset().getTelephones()); PrintArray(vCard.getDeliveryAddressingRecordset().getAddresses()); // ... } } } private static void PrintArray(String[] values) { if (values != null) { for (String value : values) { System.out.println(value); } } }
Modifier and Type | Method and Description |
---|---|
VCardPackage |
getVCardPackage()
Gets the VCard metadata package.
|
getFileType, sanitize
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, setProperties, updateProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final VCardPackage getVCardPackage()
Gets the VCard metadata package.