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(freemarker.template.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(freemarker.template.Template template)
template - the template to usepublic void add(VCard vcard)
vcard - the vCard to addpublic String write() throws freemarker.template.TemplateException
freemarker.template.TemplateException - if there's a problem processing the templatepublic void write(OutputStream out) throws IOException, freemarker.template.TemplateException
out - the output streamIOException - if there's a problem writing to the output streamfreemarker.template.TemplateException - if there's a problem processing the templatepublic void write(Path file) throws IOException, freemarker.template.TemplateException
file - the fileIOException - if there's a problem writing to the filefreemarker.template.TemplateException - if there's a problem processing the templatepublic void write(Writer writer) throws IOException, freemarker.template.TemplateException
writer - the writerIOException - if there's a problem writing to the writerfreemarker.template.TemplateException - if there's a problem processing the templateCopyright © 2012–2026 Michael Angstadt. All rights reserved.