|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectezvcard.io.html.HCardReader
public class HCardReader
Parses VCard objects from an HTML page (hCard format).
Example:
URL url = new URL("http://example.com");
HCardReader hcardReader = new HCardReader(url);
VCard vcard;
while ((vcard = hcardReader.readNext()) != null){
...
}
| Constructor Summary | |
|---|---|
HCardReader(File file)
Creates a reader that parses hCards from a file. |
|
HCardReader(File file,
String pageUrl)
Creates a reader that parses hCards from a file. |
|
HCardReader(InputStream in)
Creates a reader that parses hCards from an input stream. |
|
HCardReader(InputStream in,
String pageUrl)
Creates a reader that parses hCards from an input stream. |
|
HCardReader(Reader reader)
Creates a reader that parses hCards from a reader. |
|
HCardReader(Reader reader,
String pageUrl)
Creates a reader that parses hCards from a reader. |
|
HCardReader(String html)
Creates a reader that parses hCards from a string. |
|
HCardReader(String html,
String pageUrl)
Creates a reader that parses hCards from a string. |
|
HCardReader(URL url)
Creates a reader that parses hCards from a URL. |
|
| Method Summary | |
|---|---|
ScribeIndex |
getScribeIndex()
Gets the scribe index. |
List<String> |
getWarnings()
Gets the warnings from the last vCard that was unmarshalled. |
VCard |
readNext()
Reads the next vCard from the data stream. |
void |
registerScribe(VCardPropertyScribe<? extends VCardProperty> scribe)
Registers a property scribe. |
void |
setScribeIndex(ScribeIndex index)
Sets the scribe index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HCardReader(URL url)
throws IOException
url - the URL of the webpage
IOException - if there's a problem loading the webpage
public HCardReader(InputStream in)
throws IOException
in - the input stream to the HTML page
IOException - if there's a problem reading the HTML page
public HCardReader(InputStream in,
String pageUrl)
throws IOException
in - the input stream to the HTML pagepageUrl - the original URL of the HTML page
IOException - if there's a problem reading the HTML page
public HCardReader(File file)
throws IOException
file - the HTML file
IOException - if there's a problem reading the HTML file
public HCardReader(File file,
String pageUrl)
throws IOException
file - the HTML filepageUrl - the original URL of the HTML page
IOException - if there's a problem reading the HTML file
public HCardReader(Reader reader)
throws IOException
reader - the input stream to the HTML page
IOException - if there's a problem reading the HTML page
public HCardReader(Reader reader,
String pageUrl)
throws IOException
reader - the input stream to the HTML pagepageUrl - the original URL of the HTML page
IOException - if there's a problem reading the HTML pagepublic HCardReader(String html)
html - the HTML page
public HCardReader(String html,
String pageUrl)
html - the HTML pagepageUrl - the original URL of the HTML page| Method Detail |
|---|
public void registerScribe(VCardPropertyScribe<? extends VCardProperty> scribe)
Registers a property scribe. This is the same as calling:
getScribeIndex().register(scribe)
scribe - the scribe to registerpublic ScribeIndex getScribeIndex()
public void setScribeIndex(ScribeIndex index)
index - the scribe indexpublic List<String> getWarnings()
public VCard readNext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||