ezvcard.io.html
Class HCardPage

java.lang.Object
  extended by ezvcard.io.html.HCardPage

public class HCardPage
extends Object

Writes VCard objects to a templated HTML page (hCard format).

Example:

 VCard vcard1 = ...
 VCard vcard2 = ...
 
 HCardPage page = new HCardPage();
 page.add(vcard1);
 page.add(vcard2);
 
 File file = new File("hcard.html");
 page.write(file);
 

Author:
Michael Angstadt
See Also:
http://microformats.org/wiki/hcard

Nested Class Summary
static class HCardPage.DataUriGenerator
          Generates data URIs for the freemarker template.
 
Constructor Summary
HCardPage()
           
 
Method Summary
 void add(VCard vcard)
          Adds a vCard to the HTML page.
 String write()
          Writes the HTML document to a string.
 void write(File file)
          Writes the HTML document to a file.
 void write(OutputStream out)
          Writes the HTML document to an output stream.
 void write(Writer writer)
          Writes the HTML document to a writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HCardPage

public HCardPage()
Method Detail

add

public void add(VCard vcard)
Adds a vCard to the HTML page.

Parameters:
vcard - the vCard to add

write

public String write()
Writes the HTML document to a string.

Returns:
the HTML document

write

public void write(OutputStream out)
           throws IOException
Writes the HTML document to an output stream.

Parameters:
out - the output stream
Throws:
IOException - if there's a problem writing to the output stream

write

public void write(File file)
           throws IOException
Writes the HTML document to a file.

Parameters:
file - the file
Throws:
IOException - if there's a problem writing to the file

write

public void write(Writer writer)
           throws IOException
Writes the HTML document to a writer.

Parameters:
writer - the writer
Throws:
IOException - if there's a problem writing to the writer


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