public abstract class Fetcher<I> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Fetcher.FetchField |
static class |
Fetcher.HtmlFetcher |
static class |
Fetcher.JsonFetcher |
Modifier and Type | Field and Description |
---|---|
protected List<Fetcher.FetchField> |
fields |
protected String |
listSelector |
protected String |
sourceUrl |
Constructor and Description |
---|
Fetcher() |
Modifier and Type | Method and Description |
---|---|
List<Map<String,String>> |
fetch() |
List<Fetcher.FetchField> |
getFields() |
String |
getListSelector() |
String |
getSourceUrl() |
protected abstract String |
getValue(I item,
Fetcher.FetchField field) |
static void |
main(String[] args) |
protected Map<String,String> |
parseItem(I item) |
protected abstract Iterator<I> |
parseItems(String content) |
void |
setFields(List<Fetcher.FetchField> fields) |
void |
setListSelector(String listSelector) |
void |
setSourceUrl(String sourceUrl) |
protected String sourceUrl
protected String listSelector
protected List<Fetcher.FetchField> fields
public static void main(String[] args) throws MalformedURLException, Exception
MalformedURLException
Exception
public String getSourceUrl()
public void setSourceUrl(String sourceUrl)
public String getListSelector()
public void setListSelector(String listSelector)
public List<Fetcher.FetchField> getFields()
public void setFields(List<Fetcher.FetchField> fields)
protected abstract String getValue(I item, Fetcher.FetchField field)
Copyright © 2012-2018. All Rights Reserved.