Package com.jbstrap.jbmap.geocoding
Class GeoCodingBase<T extends GeoCodingBase<?>>
java.lang.Object
com.jbstrap.jbmap.geocoding.GeoCodingBase<T>
- Type Parameters:
T- GeoCoding base class type
- Direct Known Subclasses:
OSMGeoCoding
GeoCodingBase abstract base class. Extend this class to create a GeoCoding class. You can integrate any GeoCoding service provider in the created GeoCoding class.
In the GeoCoding process, a text description of a place (an address or a place name) returns the geographical coordinates of the place. Reverse GeoCoding means that geographical coordinates return the descrption of a place.
- Since:
- 4.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe base URL provided by a geocoding service.protected ObjectGets a parameter from the GeoCoding service provider's URL address.protected StringgetPath()Gets the path associated with the URL.protected TrustManager[]Gets the specified TrustManager.protected TremoveParam(String name) Removes a parameter from the GeoCoding service provider's URL address.protected List<com.jbstrap.core.dao.Record>runQuery()Initiates the search process using the URL and returns a list of records.abstract List<com.jbstrap.core.dao.Record>Search abstract method.protected TAdds a parameter to the GeoCoding service provider's URL address.protected TSets the path corresponding to the URL.protected TsetTrustManager(TrustManager[] trustManager) Custom TrustManager.
-
Constructor Details
-
GeoCodingBase
Creates a GeoCodingBase.- Parameters:
baseUrl- GeoCoding service provider URL- Throws:
NullPointerException- Thrown if the"baseUrl"parameter isnull
-
-
Method Details
-
getBaseUrl
The base URL provided by a geocoding service.- Returns:
- Base URL for the geocoding service
-
setPath
Sets the path corresponding to the URL.- Parameters:
path- Path corresponding to the base URL- Returns:
- Class instance extended from the GeoCodingBase abstract class
-
getPath
Gets the path associated with the URL.- Returns:
- path The path associated with the base URL
-
setParam
Adds a parameter to the GeoCoding service provider's URL address.- Parameters:
name- Parameter namevalue- Parameter value- Returns:
- Class instance extended from the GeoCodingBase abstract class
- Throws:
NullPointerException- Thrown if the value of thenameparameter isnull
-
removeParam
Removes a parameter from the GeoCoding service provider's URL address.- Parameters:
name- Parameter name- Returns:
- Class instance extended from the GeoCodingBase abstract class
-
getParam
Gets a parameter from the GeoCoding service provider's URL address.- Parameters:
name- Parameter name- Returns:
- Parameter value
-
prepareUrl
-
search
Search abstract method. Required to implement. Use the setParam() method to set the text and the runQuery() method to perform the query. The returned result is a list of records (you specify this to the method).- Parameters:
searchText- Search address or place- Returns:
- Search results in a list of records
-
runQuery
Initiates the search process using the URL and returns a list of records.- Returns:
- Search results in a list of records
-
getTrustManager
Gets the specified TrustManager.- Returns:
- TrustManager or
nullif not specified
-
setTrustManager
Custom TrustManager.- Parameters:
trustManager- Custom TrustManagerTrustManager- Returns:
- Class instance extended from the GeoCodingBase abstract class
-