|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.marlovits.addressSearch.directories.HtmlParser
ch.marlovits.addressSearch.directories.PhoneBookContentParser
public abstract class PhoneBookContentParser
Constructor Summary | |
---|---|
PhoneBookContentParser(java.lang.String name,
java.lang.String geo,
int pageNum,
java.lang.String charSet)
this is the constructor: save name, geo and pageNum in members, calc htmlText and save in members too |
Method Summary | |
---|---|
static java.lang.String |
extractFirstnames(java.lang.String firstnames,
java.lang.String delimiter)
extract the firstnames from the input String |
abstract java.util.List<java.util.HashMap<java.lang.String,java.lang.String>> |
extractKontakte()
extracts Kontakte from HTML extract [entriesPerPage] number of entries Abstract function, must override |
abstract java.util.HashMap<java.lang.String,java.lang.String> |
extractKontaktFromDetail()
extracts a Kontakt from a DetailEntry (single result displayed on a page) this just extracts the parts needed for the display in the results list if the actual detail info is needed, then the vCards are extracted this procedure can be the same as extracting from a list - for ch this is different from extractListKontakt - for de this is the same as extractListKontakt - for at this is the same as extractListKontakt Abstract function, must override |
abstract java.util.HashMap<java.lang.String,java.lang.String> |
extractKontaktFromList()
extracts a Kontakt from a listEntry (multiple results displayed on a page) this just extracts the parts needed for the display in the results list if the actual detail info is needed, then the vCards are extracted Abstract function, must override |
abstract java.util.HashMap<java.lang.String,java.lang.String> |
extractMaxInfo(java.util.HashMap<java.lang.String,java.lang.String> kontaktHashMap)
extracts a Kontakt with ALL available info from a vCard and /or html combined usually if there is a vCard then it is better to use this to get the data |
static java.lang.String |
formatPhoneNumber(java.lang.String phoneNumber)
Format a phone number according to the country of the subclass |
static java.lang.String |
formatPhoneNumber(java.lang.String phoneNumber,
java.lang.String inFormat,
java.lang.String outFormat)
Format a phone number according to your needs. |
static java.lang.String |
formatString(java.lang.String sourceString)
reformat string correctly which came from vCard from tel.local.ch |
abstract java.lang.String[][] |
getCitiesList()
returns a list of possible city names if the entered city could not be found or matched exactly |
abstract java.lang.String |
getCitiesListMessage()
if there is more than one city to select from then this procedure extracts the error message to show to the user for explaining |
abstract java.lang.String[][] |
getCitySuggestions(java.lang.String part)
|
abstract int |
getNumOfEntries()
extracts the total number of found entries Abstract function, must override |
abstract java.lang.String |
getSearchInfo()
extract infos for the current search from HTML-source - für die Suche in ch - tel.search.ch zBsp "Treffer 1 - 10 von 11" - für die Suche in de - telefonbuch.de zBsp "Seite 1 (von 6)" - für die Suche in at - herold.at/telefonbuch zBsp "Treffer 1-15 von 61" Abstract function, must override |
abstract java.net.URL |
getURL(java.lang.String name,
java.lang.String geo,
int pageNum)
creates and returns a URL for reading data from an online-address-query page Abstract function, must override |
abstract boolean |
hasCitiesList()
test if the query returned saying that there is more than one city to select from |
void |
initHashMap(java.util.HashMap<java.lang.String,java.lang.String> entry)
|
abstract boolean |
noCityFound()
test if the there entered city has been found or not |
static java.lang.String |
readContent(java.lang.String urlText,
java.lang.String charSet,
int timeout)
read and return the contents of a html page |
java.lang.String |
readContent(java.lang.String name,
java.lang.String geo,
int pageNum,
java.lang.String charSet,
int timeout)
read and return the contents of a html page, uses default character encoding timeout needed because on telefonbuch.de vCards sometimes do not work correctly... |
Methods inherited from class ch.marlovits.addressSearch.directories.HtmlParser |
---|
extract, extractTo, getNextPos, getNextPos, getTail, moveTo, reset, setHtmlText, startsWith |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PhoneBookContentParser(java.lang.String name, java.lang.String geo, int pageNum, java.lang.String charSet)
name
- search for this namegeo
- search in this city/locationpageNum
- which page to get, zero-basedMethod Detail |
---|
public abstract java.lang.String getSearchInfo()
public abstract int getNumOfEntries()
public abstract java.util.List<java.util.HashMap<java.lang.String,java.lang.String>> extractKontakte()
public abstract java.util.HashMap<java.lang.String,java.lang.String> extractKontaktFromList()
public abstract java.util.HashMap<java.lang.String,java.lang.String> extractKontaktFromDetail()
public abstract java.util.HashMap<java.lang.String,java.lang.String> extractMaxInfo(java.util.HashMap<java.lang.String,java.lang.String> kontaktHashMap)
kontaktHashMap
- Kontakt for which to extract the info
public abstract boolean hasCitiesList()
public abstract java.lang.String getCitiesListMessage()
public abstract java.lang.String[][] getCitiesList()
public abstract boolean noCityFound()
public abstract java.lang.String[][] getCitySuggestions(java.lang.String part)
public static java.lang.String extractFirstnames(java.lang.String firstnames, java.lang.String delimiter)
firstnames
- inputdelimiter
- used to separate the firstnames for the result string
public static java.lang.String formatString(java.lang.String sourceString)
sourceString
-
public static java.lang.String formatPhoneNumber(java.lang.String phoneNumber)
phoneNumber
- the phoneNumber as returned from html
public static java.lang.String formatPhoneNumber(java.lang.String phoneNumber, java.lang.String inFormat, java.lang.String outFormat)
phoneNumber
- the phoneNumber as returned from htmlinFormat
- the format of the inputoutFormat
- how to format the output
public abstract java.net.URL getURL(java.lang.String name, java.lang.String geo, int pageNum)
name
- search for this namegeo
- search in this city/locationpageNum
- which page to get
public java.lang.String readContent(java.lang.String name, java.lang.String geo, int pageNum, java.lang.String charSet, int timeout)
name
- search for this namegeo
- search in this city/locationpageNum
- which page to gettimeOut
- = how long to wait for the page to be returned in milliseconds, 0 = no timeout
public static java.lang.String readContent(java.lang.String urlText, java.lang.String charSet, int timeout)
urlText
- = the url from where the page should be readcharSet
- = the character set to be used for page-encodingtimeOut
- = how long to wait for the page to be returned in milliseconds, 0 = no timeout
public void initHashMap(java.util.HashMap<java.lang.String,java.lang.String> entry)
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |