
This is a Java API binding of the IETF Mime-Dir and vCard RFC's.

This package defines implementation neutral Mime-Dir and vCard Java interfaces for exposing data objects corresponding to those defined by the RFC's.

There is also a minimal sample implementation included.

The interfaces defined by this package are primarily implemented by developers of Mime-Dir and vCard parsers in Java.  Users can write code against these API's to avoid tying their code to any one implementation.  This project includes a second package, mime-dir-j-vcard4j, containing patched version of vCard4J which implements this API.

The method by which a developer obtains an concrete instance object implementing these interfaces is implementation specific and not defined by this API package.  The sample implementation included here does not include a vCard parser, but can be used to programatically create and write out a vCard or other Mime-Dir format data:

import org.ietf.mimedir.*;
import org.ietf.mimedir.impl.*;
import org.ietf.mimedir.vcard.*;
import org.ietf.mimedir.vcard.impl.*;

public static final VCard buildVCardProgramatically() {
  final MimeDir.ContentLine fn = new MimeDirImpl.ContentLine(null, "FN", null, MimeDirImpl.TextValueType.newTextValueType("Chris Hubick"));
  final MimeDir.TextListValueType familyName = MimeDirImpl.TextListValueType.newTextListValueType("Hubick");
  final MimeDir.TextListValueType givenName = MimeDirImpl.TextListValueType.newTextListValueType("Christopher");
  final MimeDir.ContentLine n = new MimeDirImpl.ContentLine(null, "N", null, VCardImpl.StructuredValueType.newStructuredValueType(new MimeDir.ListValueType[] { familyName, givenName }));
  final MimeDir.ContentLine version = new MimeDirImpl.ContentLine(null, "VERSION", null, MimeDirImpl.TextValueType.newTextValueType("3.0"));
  return new VCardImpl(new MimeDir.ContentLine[] { fn, n, version });
}

The mime-dir-j-vcard4j implementation package includes a full example of how a developer can parse a vCard to obtain a MimeDir/VCard interface instance using that implementation.

The usage of these simple API's should be straight-forward and self-evident to anyone familiar with the Mime-Dir or vCard data formats.  If you need additional documentation, I recommend referencing the associated RFC's:

Mime-Dir:  http://www.ietf.org/rfc/rfc2425.txt
vCard:  http://www.ietf.org/rfc/rfc2426.txt
