Package org.javlo.component.dynamic
Class Fetcher<I>
- java.lang.Object
-
- org.javlo.component.dynamic.Fetcher<I>
-
- Direct Known Subclasses:
Fetcher.HtmlFetcher
,Fetcher.JsonFetcher
public abstract class Fetcher<I> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Fetcher.FetchField
static class
Fetcher.HtmlFetcher
static class
Fetcher.JsonFetcher
-
Field Summary
Fields Modifier and Type Field Description protected List<Fetcher.FetchField>
fields
protected String
listSelector
protected String
sourceUrl
-
Constructor Summary
Constructors Constructor Description Fetcher()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
sourceUrl
protected String sourceUrl
-
listSelector
protected String listSelector
-
fields
protected List<Fetcher.FetchField> fields
-
-
Method Detail
-
main
public static void main(String[] args) throws MalformedURLException, Exception
- Throws:
MalformedURLException
Exception
-
getSourceUrl
public String getSourceUrl()
-
setSourceUrl
public void setSourceUrl(String sourceUrl)
-
getListSelector
public String getListSelector()
-
setListSelector
public void setListSelector(String listSelector)
-
getFields
public List<Fetcher.FetchField> getFields()
-
setFields
public void setFields(List<Fetcher.FetchField> fields)
-
getValue
protected abstract String getValue(I item, Fetcher.FetchField field)
-
-