ezvcard
Class Ezvcard

java.lang.Object
  extended by ezvcard.Ezvcard

public class Ezvcard
extends Object

Contains helper methods for parsing/writing vCards. The methods wrap the following classes:

Reading Writing
Plain text VCardReader VCardWriter
XML XCardReader XCardDocument
HTML HCardReader HCardPage

Author:
Michael Angstadt

Nested Class Summary
static class Ezvcard.ParserChainHtmlReader
          Convenience chainer class for parsing HTML vCards.
static class Ezvcard.ParserChainHtmlString
          Convenience chainer class for parsing HTML vCards.
static class Ezvcard.ParserChainTextReader
          Convenience chainer class for parsing plain text vCards.
static class Ezvcard.ParserChainTextString
          Convenience chainer class for parsing plain text vCards.
static class Ezvcard.ParserChainXmlDom
          Convenience chainer class for parsing XML vCards.
static class Ezvcard.ParserChainXmlReader
          Convenience chainer class for parsing XML vCards.
static class Ezvcard.ParserChainXmlString
          Convenience chainer class for parsing XML vCards.
static class Ezvcard.WriterChainHtml
          Convenience chainer class for writing HTML vCards (hCard).
static class Ezvcard.WriterChainTextMulti
          Convenience chainer class for writing plain text vCards
static class Ezvcard.WriterChainTextSingle
          Convenience chainer class for writing plain text vCards
static class Ezvcard.WriterChainXmlMulti
          Convenience chainer class for writing XML vCards (xCard).
static class Ezvcard.WriterChainXmlSingle
          Convenience chainer class for writing XML vCards (xCard).
 
Field Summary
static String URL
          The project webpage.
static String VERSION
          The version of the library.
 
Method Summary
static Ezvcard.ParserChainTextReader parse(File file)
           Parses plain text vCards.
static Ezvcard.ParserChainTextReader parse(InputStream in)
           Parses plain text vCards.
static Ezvcard.ParserChainTextReader parse(Reader reader)
           Parses plain text vCards.
static Ezvcard.ParserChainTextString parse(String str)
           Parses plain text vCards.
static Ezvcard.ParserChainHtmlReader parseHtml(File file)
           Parses HTML-encoded vCards (hCard).
static Ezvcard.ParserChainHtmlReader parseHtml(InputStream in)
           Parses HTML-encoded vCards (hCard).
static Ezvcard.ParserChainHtmlReader parseHtml(Reader reader)
           Parses HTML-encoded vCards (hCard).
static Ezvcard.ParserChainHtmlString parseHtml(String html)
           Parses HTML-encoded vCards (hCard).
static Ezvcard.ParserChainHtmlReader parseHtml(URL url)
           Parses HTML-encoded vCards (hCard).
static Ezvcard.ParserChainXmlDom parseXml(Document document)
           Parses XML-encoded vCards (xCard).
static Ezvcard.ParserChainXmlReader parseXml(File file)
           Parses XML-encoded vCards (xCard).
static Ezvcard.ParserChainXmlReader parseXml(InputStream in)
           Parses XML-encoded vCards (xCard).
static Ezvcard.ParserChainXmlReader parseXml(Reader reader)
           Parses XML-encoded vCards (xCard).
static Ezvcard.ParserChainXmlString parseXml(String xml)
           Parses XML-encoded vCards (xCard).
static Ezvcard.WriterChainTextMulti write(Collection<VCard> vcards)
           Marshals multiple vCards to their traditional, plain-text representation.
static Ezvcard.WriterChainTextMulti write(VCard... vcards)
           Marshals multiple vCards to their traditional, plain-text representation.
static Ezvcard.WriterChainTextSingle write(VCard vcard)
           Marshals a vCard to its traditional, plain-text representation.
static Ezvcard.WriterChainHtml writeHtml(Collection<VCard> vcards)
           Marshals one or more vCards their HTML representation (hCard).
static Ezvcard.WriterChainHtml writeHtml(VCard... vcards)
           Marshals one or more vCards their HTML representation (hCard).
static Ezvcard.WriterChainXmlMulti writeXml(Collection<VCard> vcards)
           Marshals multiple vCards to their XML representation (xCard).
static Ezvcard.WriterChainXmlMulti writeXml(VCard... vcards)
           Marshals multiple vCards to their XML representation (xCard).
static Ezvcard.WriterChainXmlSingle writeXml(VCard vcard)
           Marshals a vCard to its XML representation (xCard).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
The version of the library.


URL

public static final String URL
The project webpage.

Method Detail

parse

public static Ezvcard.ParserChainTextString parse(String str)

Parses plain text vCards.

Use VCardReader for more control over the parsing.

Parameters:
str - the vCard string
Returns:
chainer object for completing the parse operation
See Also:
VCardReader, vCard 2.1, RFC 2426 (3.0), RFC 6350 (4.0)

parse

public static Ezvcard.ParserChainTextReader parse(File file)
                                           throws FileNotFoundException

Parses plain text vCards.

Use VCardReader for more control over the parsing.

Parameters:
file - the vCard file
Returns:
chainer object for completing the parse operation
Throws:
FileNotFoundException - if the file does not exist or cannot be accessed
See Also:
VCardReader, vCard 2.1, RFC 2426 (3.0), RFC 6350 (4.0)

parse

public static Ezvcard.ParserChainTextReader parse(InputStream in)

Parses plain text vCards.

Use VCardReader for more control over the parsing.

Parameters:
in - the input stream
Returns:
chainer object for completing the parse operation
See Also:
VCardReader, vCard 2.1, RFC 2426 (3.0), RFC 6350 (4.0)

parse

public static Ezvcard.ParserChainTextReader parse(Reader reader)

Parses plain text vCards.

Use VCardReader for more control over the parsing.

Parameters:
reader - the reader
Returns:
chainer object for completing the parse operation
See Also:
VCardReader, vCard 2.1, RFC 2426 (3.0), RFC 6350 (4.0)

parseXml

public static Ezvcard.ParserChainXmlString parseXml(String xml)

Parses XML-encoded vCards (xCard).

Use XCardReader for more control over the parsing.

Parameters:
xml - the XML document
Returns:
chainer object for completing the parse operation
See Also:
XCardReader, RFC 6351

parseXml

public static Ezvcard.ParserChainXmlReader parseXml(File file)
                                             throws FileNotFoundException

Parses XML-encoded vCards (xCard).

Use XCardReader for more control over the parsing.

Parameters:
file - the XML file
Returns:
chainer object for completing the parse operation
Throws:
FileNotFoundException - if the file does not exist or cannot be accessed
See Also:
XCardReader, RFC 6351

parseXml

public static Ezvcard.ParserChainXmlReader parseXml(InputStream in)

Parses XML-encoded vCards (xCard).

Use XCardReader for more control over the parsing.

Parameters:
in - the input stream to the XML document
Returns:
chainer object for completing the parse operation
See Also:
XCardReader, RFC 6351

parseXml

public static Ezvcard.ParserChainXmlReader parseXml(Reader reader)

Parses XML-encoded vCards (xCard).

Use XCardReader for more control over the parsing.

Parameters:
reader - the reader to the XML document
Returns:
chainer object for completing the parse operation
See Also:
XCardReader, RFC 6351

parseXml

public static Ezvcard.ParserChainXmlDom parseXml(Document document)

Parses XML-encoded vCards (xCard).

Use XCardReader for more control over the parsing.

Parameters:
document - the XML document
Returns:
chainer object for completing the parse operation
See Also:
XCardReader, RFC 6351

parseHtml

public static Ezvcard.ParserChainHtmlString parseHtml(String html)

Parses HTML-encoded vCards (hCard).

Use HCardReader for more control over the parsing.

Parameters:
html - the HTML page
Returns:
chainer object for completing the parse operation
See Also:
HCardReader, hCard 1.0

parseHtml

public static Ezvcard.ParserChainHtmlReader parseHtml(File file)
                                               throws FileNotFoundException

Parses HTML-encoded vCards (hCard).

Use HCardReader for more control over the parsing.

Parameters:
file - the HTML file
Returns:
chainer object for completing the parse operation
Throws:
FileNotFoundException - if the file does not exist or cannot be accessed
See Also:
HCardReader, hCard 1.0

parseHtml

public static Ezvcard.ParserChainHtmlReader parseHtml(InputStream in)

Parses HTML-encoded vCards (hCard).

Use HCardReader for more control over the parsing.

Parameters:
in - the input stream to the HTML page
Returns:
chainer object for completing the parse operation
See Also:
HCardReader, hCard 1.0

parseHtml

public static Ezvcard.ParserChainHtmlReader parseHtml(Reader reader)

Parses HTML-encoded vCards (hCard).

Use HCardReader for more control over the parsing.

Parameters:
reader - the reader to the HTML page
Returns:
chainer object for completing the parse operation
See Also:
HCardReader, hCard 1.0

parseHtml

public static Ezvcard.ParserChainHtmlReader parseHtml(URL url)

Parses HTML-encoded vCards (hCard).

Use HCardReader for more control over the parsing.

Parameters:
url - the URL of the webpage
Returns:
chainer object for completing the parse operation
See Also:
HCardReader, hCard 1.0

write

public static Ezvcard.WriterChainTextSingle write(VCard vcard)

Marshals a vCard to its traditional, plain-text representation.

Use VCardWriter for more control over how the vCard is written.

Parameters:
vcard - the vCard to marshal
Returns:
chainer object for completing the write operation
See Also:
VCardWriter, vCard 2.1, RFC 2426 (3.0), RFC 6350 (4.0)

write

public static Ezvcard.WriterChainTextMulti write(VCard... vcards)

Marshals multiple vCards to their traditional, plain-text representation.

Use VCardWriter for more control over how the vCards are written.

Parameters:
vcards - the vCards to marshal
Returns:
chainer object for completing the write operation
See Also:
VCardWriter, vCard 2.1, RFC 2426 (3.0), RFC 6350 (4.0)

write

public static Ezvcard.WriterChainTextMulti write(Collection<VCard> vcards)

Marshals multiple vCards to their traditional, plain-text representation.

Use VCardWriter for more control over how the vCards are written.

Parameters:
vcards - the vCards to marshal
Returns:
chainer object for completing the write operation
See Also:
VCardWriter, vCard 2.1, RFC 2426 (3.0), RFC 6350 (4.0)

writeXml

public static Ezvcard.WriterChainXmlSingle writeXml(VCard vcard)

Marshals a vCard to its XML representation (xCard).

Use XCardDocument for more control over how the vCard is written.

Parameters:
vcard - the vCard to marshal
Returns:
chainer object for completing the write operation
See Also:
XCardDocument, RFC 6351

writeXml

public static Ezvcard.WriterChainXmlMulti writeXml(VCard... vcards)

Marshals multiple vCards to their XML representation (xCard).

Use XCardDocument for more control over how the vCards are written.

Parameters:
vcards - the vCards to marshal
Returns:
chainer object for completing the write operation
See Also:
XCardDocument, RFC 6351

writeXml

public static Ezvcard.WriterChainXmlMulti writeXml(Collection<VCard> vcards)

Marshals multiple vCards to their XML representation (xCard).

Use XCardDocument for more control over how the vCards are written.

Parameters:
vcards - the vCard to marshal
Returns:
chainer object for completing the write operation
See Also:
XCardDocument, RFC 6351

writeHtml

public static Ezvcard.WriterChainHtml writeHtml(VCard... vcards)

Marshals one or more vCards their HTML representation (hCard).

Use HCardPage for more control over how the vCards are written.

Parameters:
vcards - the vCard(s) to marshal
Returns:
chainer object for completing the write operation
See Also:
HCardPage, hCard 1.0

writeHtml

public static Ezvcard.WriterChainHtml writeHtml(Collection<VCard> vcards)

Marshals one or more vCards their HTML representation (hCard).

Use HCardPage for more control over how the vCards are written.

Parameters:
vcards - the vCard(s) to marshal
Returns:
chainer object for completing the write operation
See Also:
HCardPage, hCard 1.0


Copyright © 2012-2013. All Rights Reserved.