|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcitysdk.tourism.client.parser.DataReader
public class DataReader
Used as an aid to get data from a
POI-based object. It abstract the
parsing of data and gets the information needed specified by the application
using a given set of terms or languages. In case a given language is not
found, it defaults to en_GB.
| Constructor Summary | |
|---|---|
DataReader()
|
|
| Method Summary | |
|---|---|
static java.util.Map<java.lang.String,java.util.Locale> |
getAvailableLangs(POI poi,
Field field)
Gets a mapping of all the available languages of a given field in the POI object. |
static java.lang.String |
getCalendar(POI poi,
Term term)
Returns an iCalendar of the given term. |
static java.util.List<java.lang.String> |
getCategories(POI poi,
java.util.Locale lang)
Gets the categories in a given language. |
static java.lang.String |
getContacts(POI poi)
Gets the contacts in vCard format |
static java.lang.String |
getDescription(POI poi,
java.util.Locale lang)
Gets the description in a given language. |
static java.util.List<ImageContent> |
getImagesUri(POI poi)
Gets all the URI images of the given POI object. |
static java.lang.String |
getLabel(POI poi,
Term term,
java.util.Locale lang)
Gets the label with the given term in a given language. |
static java.lang.String |
getLink(POI poi,
Term term)
Returns the link with a given term. |
static java.util.List<GeometryContent> |
getLocationGeometry(POI poi,
Term term)
Gets a list of points of the POI object with the given term. |
static java.util.List<LineContent> |
getLocationLine(POI poi,
Term term)
Gets a list of lines of the POI object with the given term. |
static java.util.List<PointContent> |
getLocationPoint(POI poi,
Term term)
Gets a list of points of the POI object with the given term. |
static java.util.List<PolygonContent> |
getLocationPolygon(POI poi,
Term term)
Gets a list of polygons of the POI object with the given term. |
static java.lang.String |
getOccupation(POI poi)
Gets the occupation in a given language. |
static java.lang.String |
getPrice(POI poi,
java.util.Locale lang)
Gets the price in a given language. |
static java.lang.String |
getRelationshipBase(POI poi,
Term term)
Gets the relationship base with a given term. |
static java.lang.String |
getRelationshipId(POI poi,
Term term)
Gets the relationship id with a given term. |
static java.util.List<java.lang.String> |
getTags(ListTag list,
java.util.Locale lang)
Gets the tags within the list of tags in a given language. |
static java.util.List<ImageContent> |
getThumbnails(POI poi)
Gets all the thumbnails in 64-base bytecode or URI |
static java.lang.String |
getWaitingTime(POI poi)
Gets the waiting time in a given language. |
static void |
setDefaultLocale(java.util.Locale locale)
Sets the default locale. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataReader()
| Method Detail |
|---|
public static void setDefaultLocale(java.util.Locale locale)
locale - the default locale.
public static java.util.Map<java.lang.String,java.util.Locale> getAvailableLangs(POI poi,
Field field)
POI object.
poi - the object to get the data.field - the wanted field
public static java.lang.String getLabel(POI poi,
Term term,
java.util.Locale lang)
poi - the object to get the data.term - the term used.lang - the wanted language.
String
containing the following: the value of the label in the given
language. If such language is not found it will return in default
language and if the default language is not present it will
return a DataContent containing null.
public static java.lang.String getDescription(POI poi,
java.util.Locale lang)
poi - the object to get the data.lang - the wanted language.
String
containing the following: the value of the description in the
desired language or in the default language if none found or
null.
public static java.util.List<java.lang.String> getCategories(POI poi,
java.util.Locale lang)
poi - the object to get the data.lang - the wanted language.
public static java.lang.String getPrice(POI poi,
java.util.Locale lang)
poi - the object to get the data.lang - the wanted language.
String
containing the following: the value of the price in the desired
language or in the default language if it was not found or null
if the default language is not present.public static java.lang.String getWaitingTime(POI poi)
poi - the object to get the data.
String
containing the waiting time (in seconds) or null.public static java.lang.String getOccupation(POI poi)
poi - the object to get the data.
String
containing the occupation value (0 to 100) or null.public static java.util.List<ImageContent> getThumbnails(POI poi)
poi - the object to get the data.
ImageContent
where each element contains the following: the bytecode (base-64)
or URI of the thumbnail, or an empty list if none found.
public static java.util.List<GeometryContent> getLocationGeometry(POI poi,
Term term)
poi - the object to get the data.term - the term to be used.
GeometryContent)
containing all geometries with the given term or an empty list.
public static java.util.List<PointContent> getLocationPoint(POI poi,
Term term)
Point geometry.
poi - the object to get the data.term - the term to be used.
PointContent)
containing all points with the given term or an empty list.
public static java.util.List<LineContent> getLocationLine(POI poi,
Term term)
Line geometry.
poi - the object to get the data.term - the term to be used.
LineContent
) containing all lines with the given term or an empty list.
public static java.util.List<PolygonContent> getLocationPolygon(POI poi,
Term term)
Polygon geometry.
poi - the object to get the data.term - the term to be used.
PolygonContent)
containing all polygons with the given term or an empty list.public static java.lang.String getContacts(POI poi)
poi - the object to get the data.
public static java.lang.String getCalendar(POI poi,
Term term)
poi - the object to get the data.term - the term to search for.
public static java.util.List<ImageContent> getImagesUri(POI poi)
poi - the object to get the data.
ImageContent) of the
images or an empty list if none were found.
public static java.lang.String getRelationshipBase(POI poi,
Term term)
poi - the object to get the data.term - the term used.
String
containing the relationship base with the given term or null if
none was found.
public static java.lang.String getRelationshipId(POI poi,
Term term)
poi - the object to get the data.term - the term used.
String
containing the relationship id with the given term or null if
none was found.
public static java.lang.String getLink(POI poi,
Term term)
poi - the object to get the data.term - the term used
String
containing a link or null if none found.
public static java.util.List<java.lang.String> getTags(ListTag list,
java.util.Locale lang)
list - the list of tags.lang - the wanted language.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||