ezvcard
Class Ezvcard

java.lang.Object
  extended by ezvcard.Ezvcard

public class Ezvcard
extends Object

Contains chaining factory methods for parsing/writing vCards. They are convenience methods that make use of the following classes:

Reading Writing
Plain text VCardReader VCardWriter
XML XCardDocument XCardDocument
HTML HCardReader HCardPage
JSON JCardReader JCardWriter

Author:
Michael Angstadt

Nested Class Summary
static class Ezvcard.ParserChainHtmlReader
          Chainer class for parsing HTML vCards.
static class Ezvcard.ParserChainHtmlString
          Chainer class for parsing HTML vCards.
static class Ezvcard.ParserChainJsonReader
          Chainer class for parsing JSON-encoded vCards (jCard).
static class Ezvcard.ParserChainJsonString
          Chainer class for parsing JSON-encoded vCards (jCard).
static class Ezvcard.ParserChainTextReader
          Chainer class for parsing plain text vCards.
static class Ezvcard.ParserChainTextString
          Chainer class for parsing plain text vCards.
static class Ezvcard.ParserChainXmlDom
          Chainer class for parsing XML vCards.
static class Ezvcard.ParserChainXmlReader
          Chainer class for parsing XML vCards.
static class Ezvcard.ParserChainXmlString
          Chainer class for parsing XML vCards.
static class Ezvcard.WriterChainHtml
          Chainer class for writing HTML vCards (hCard).
static class Ezvcard.WriterChainJson
          Chainer class for writing JSON-encoded vCards (jCard).
static class Ezvcard.WriterChainText
          Chainer class for writing plain text vCards
static class Ezvcard.WriterChainXml
          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.ParserChainJsonReader parseJson(File file)
           Parses JSON-encoded vCards (jCard).
static Ezvcard.ParserChainJsonReader parseJson(InputStream in)
           Parses JSON-encoded vCards (jCard).
static Ezvcard.ParserChainJsonReader parseJson(Reader reader)
           Parses JSON-encoded vCards (jCard).
static Ezvcard.ParserChainJsonString parseJson(String json)
           Parses JSON-encoded vCards (jCard).
static Ezvcard.ParserChainXmlDom parseXml(Document document)
           Parses XML-encoded vCards (xCard).
static Ezvcard.ParserChainXmlReader parseXml(File file)
           Parses XML-encoded vCards (xCard) from a file.
static Ezvcard.ParserChainXmlReader parseXml(InputStream in)
           Parses XML-encoded vCards (xCard) from an input stream.
static Ezvcard.ParserChainXmlReader parseXml(Reader reader)
           Parses XML-encoded vCards (xCard) from a reader.
static Ezvcard.ParserChainXmlString parseXml(String xml)
           Parses XML-encoded vCards (xCard) from a string.
static Ezvcard.WriterChainText write(Collection<VCard> vcards)
           Marshals one or more vCards to their traditional, plain-text representation.
static Ezvcard.WriterChainText write(VCard... vcards)
           Marshals one or more vCards to their 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.WriterChainJson writeJson(Collection<VCard> vcards)
           Marshals one or more vCards to their JSON representation (jCard).
static Ezvcard.WriterChainJson writeJson(VCard... vcards)
           Marshals one or more vCards to their JSON representation (jCard).
static Ezvcard.WriterChainXml writeXml(Collection<VCard> vcards)
           Marshals one or more vCards to their XML representation (xCard).
static Ezvcard.WriterChainXml writeXml(VCard... vcards)
           Marshals one or more vCards to their 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)

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
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) from a string.

Use XCardDocument for more control over the parsing.

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

parseXml

public static Ezvcard.ParserChainXmlReader parseXml(File file)

Parses XML-encoded vCards (xCard) from a file.

Use XCardDocument for more control over the parsing.

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

parseXml

public static Ezvcard.ParserChainXmlReader parseXml(InputStream in)

Parses XML-encoded vCards (xCard) from an input stream.

Use XCardDocument 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:
XCardDocument, RFC 6351

parseXml

public static Ezvcard.ParserChainXmlReader parseXml(Reader reader)

Parses XML-encoded vCards (xCard) from a reader.

Note that use of this method is discouraged. It ignores the character encoding that is defined within the XML document itself, and should only be used if the encoding is undefined or if the encoding needs to be ignored for whatever reason. The parseXml(InputStream) method should be used instead, since it takes the XML document's character encoding into account when parsing.

Use XCardDocument for more control over the parsing.

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

parseXml

public static Ezvcard.ParserChainXmlDom parseXml(Document document)

Parses XML-encoded vCards (xCard).

Use XCardDocument for more control over the parsing.

Parameters:
document - the XML document
Returns:
chainer object for completing the parse operation
See Also:
XCardDocument, 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)

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
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

parseJson

public static Ezvcard.ParserChainJsonString parseJson(String json)

Parses JSON-encoded vCards (jCard).

Use JCardReader for more control over the parsing.

Parameters:
json - the JSON string
Returns:
chainer object for completing the parse operation
See Also:
JCardReader, RFC 7095

parseJson

public static Ezvcard.ParserChainJsonReader parseJson(File file)

Parses JSON-encoded vCards (jCard).

Use JCardReader for more control over the parsing.

Parameters:
file - the JSON file
Returns:
chainer object for completing the parse operation
See Also:
JCardReader, RFC 7095

parseJson

public static Ezvcard.ParserChainJsonReader parseJson(InputStream in)

Parses JSON-encoded vCards (jCard).

Use JCardReader for more control over the parsing.

Parameters:
in - the input stream
Returns:
chainer object for completing the parse operation
See Also:
JCardReader, RFC 7095

parseJson

public static Ezvcard.ParserChainJsonReader parseJson(Reader reader)

Parses JSON-encoded vCards (jCard).

Use JCardReader for more control over the parsing.

Parameters:
reader - the reader
Returns:
chainer object for completing the parse operation
See Also:
JCardReader, RFC 7095

write

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

Marshals one or more 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.WriterChainText write(Collection<VCard> vcards)

Marshals one or more 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.WriterChainXml writeXml(VCard... vcards)

Marshals one or more 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.WriterChainXml writeXml(Collection<VCard> vcards)

Marshals one or more 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

writeJson

public static Ezvcard.WriterChainJson writeJson(VCard... vcards)

Marshals one or more vCards to their JSON representation (jCard).

Use JCardWriter 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:
JCardWriter, RFC 7095

writeJson

public static Ezvcard.WriterChainJson writeJson(Collection<VCard> vcards)

Marshals one or more vCards to their JSON representation (jCard).

Use JCardWriter 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:
JCardWriter, RFC 7095


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.