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 classFetcher.FetchFieldstatic classFetcher.HtmlFetcherstatic classFetcher.JsonFetcher
-
Field Summary
Fields Modifier and Type Field Description protected List<Fetcher.FetchField>fieldsprotected StringlistSelectorprotected StringsourceUrl
-
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()StringgetListSelector()StringgetSourceUrl()protected abstract StringgetValue(I item, Fetcher.FetchField field)static voidmain(String[] args)protected Map<String,String>parseItem(I item)protected abstract Iterator<I>parseItems(String content)voidsetFields(List<Fetcher.FetchField> fields)voidsetListSelector(String listSelector)voidsetSourceUrl(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:
MalformedURLExceptionException
-
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)
-
-