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);
| Modifier and Type | Class and Description |
|---|---|
static class |
HCardPage.TemplateUtils
Utility functions for the freemarker template.
|
| Constructor and Description |
|---|
HCardPage()
Creates a new hCard page that uses the default template.
|
HCardPage(Template template)
Creates a new hCard page using a custom template.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(VCard vcard)
Adds a vCard to the HTML page.
|
String |
write()
Writes the HTML document to a string.
|
void |
write(OutputStream out)
Writes the HTML document to an output stream.
|
void |
write(Path file)
Writes the HTML document to a file.
|
void |
write(Writer writer)
Writes the HTML document to a writer.
|
public HCardPage()
public HCardPage(Template template)
template - the template to usepublic void add(VCard vcard)
vcard - the vCard to addpublic void write(OutputStream out) throws IOException
out - the output streamIOException - if there's a problem writing to the output streampublic void write(Path file) throws IOException
file - the fileIOException - if there's a problem writing to the filepublic void write(Writer writer) throws IOException
writer - the writerIOException - if there's a problem writing to the writerCopyright © 2012–2023 Michael Angstadt. All rights reserved.