Android Open Source - AndroidPlaces Json Model






From Project

Back to project page AndroidPlaces.

License

The source code is released under:

Apache License

If you think the Android project AndroidPlaces listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2014 Brian Lee/*from w  w  w .ja  v  a 2  s.  c  o  m*/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tigerpenguin.places.model;

import android.text.Html;
import android.text.Spanned;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
public abstract class JsonModel {
    // response
    protected static final String STATUS = "status";
    protected static final String ERROR_MESSAGE = "error_message";
    protected static final String RESULT = "result";
    protected static final String RESULTS = "results";
    protected static final String HTML_ATTRIBUTIONS = "html_attributions";
    protected static final String NEXT_PAGE_TOKEN = "next_page_token";

    // place
    protected static final String ICON = "icon";
    protected static final String PLACE_ID = "place_id";
    protected static final String NAME = "name";
    protected static final String PRICE_LEVEL = "price_level";
    protected static final String TYPES = "types";
    protected static final String WEBSITE = "website";
    protected static final String UTC_OFFSET = "utc_offset";
    protected static final String URL = "url";

    // photo
    protected static final String PHOTOS = "photos";
    protected static final String PHOTO_REFERENCE = "photo_reference";
    protected static final String HEIGHT = "height";
    protected static final String WIDTH = "width";

    // opening info
    protected static final String OPENING_HOURS = "opening_hours";
    protected static final String OPEN_NOW = "open_now";
    protected static final String PERIODS = "periods";
    protected static final String OPEN = "open";
    protected static final String CLOSE = "close";
    protected static final String DAY = "day";
    protected static final String TIME = "time";

    // location
    protected static final String VICINITY = "vicinity";
    protected static final String GEOMETRY = "geometry";
    protected static final String LOCATION = "location";
    protected static final String LATITUDE = "lat";
    protected static final String LONGITUDE = "lng";
    protected static final String VIEWPORT = "viewport";

    // address
    protected static final String FORMATTED_ADDRESS = "formatted_address";
    protected static final String ADDRESS_COMPONENTS = "address_components";
    protected static final String LONG_NAME = "long_name";
    protected static final String SHORT_NAME = "short_name";
    protected static final String FORMATTED_PHONE_NUMBER = "formatted_phone_number";
    protected static final String INTERNATIONAL_PHONE_NUMBER = "international_phone_number";

    //reviews
    protected static final String RATING = "rating";
    protected static final String REVIEWS = "reviews";
    protected static final String ASPECTS = "aspects";
    protected static final String TYPE = "type";
    protected static final String AUTHOR_NAME = "author_name";
    protected static final String AUTHOR_URL = "author_url";
    protected static final String LANGUAGE = "language";
    protected static final String TEXT = "text";

    public static final Spanned squashHtmlStringList(List<String> htmlStringList, String delimiter) {
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        for (String htmlString : htmlStringList) {
            if (first) {
                first = false;
            } else {
                sb.append(delimiter);
            }
            sb.append(htmlString);
        }
        return Html.fromHtml(sb.toString());
    }
}




Java Source Code List

com.tigerpenguin.demo.places.PlaceDetailActivity.java
com.tigerpenguin.demo.places.PlaceResultAdapter.java
com.tigerpenguin.demo.places.PlaceResultsFragment.java
com.tigerpenguin.demo.places.PlaceReviewAdapter.java
com.tigerpenguin.demo.places.PlaceReviewsFragment.java
com.tigerpenguin.demo.places.PlaceThumbnailAdapter.java
com.tigerpenguin.demo.places.PlaceThumbnailsFragment.java
com.tigerpenguin.demo.places.PlacesDemo.java
com.tigerpenguin.places.PlacesTest.java
com.tigerpenguin.places.deserializer.HtmlStringDeserializer.java
com.tigerpenguin.places.deserializer.PlaceTypeDeserializer.java
com.tigerpenguin.places.model.AddressComponent.java
com.tigerpenguin.places.model.AspectRating.java
com.tigerpenguin.places.model.AspectType.java
com.tigerpenguin.places.model.DayOfWeek.java
com.tigerpenguin.places.model.DayTime.java
com.tigerpenguin.places.model.Geometry.java
com.tigerpenguin.places.model.JsonModel.java
com.tigerpenguin.places.model.Language.java
com.tigerpenguin.places.model.OpeningHours.java
com.tigerpenguin.places.model.Period.java
com.tigerpenguin.places.model.Photo.java
com.tigerpenguin.places.model.PlaceDetail.java
com.tigerpenguin.places.model.PlaceLocation.java
com.tigerpenguin.places.model.PlaceType.java
com.tigerpenguin.places.model.Place.java
com.tigerpenguin.places.model.PriceLevel.java
com.tigerpenguin.places.model.RankBy.java
com.tigerpenguin.places.model.Review.java
com.tigerpenguin.places.model.StatusCode.java
com.tigerpenguin.places.request.InvalidRequestException.java
com.tigerpenguin.places.request.NearbySearchRequestTest.java
com.tigerpenguin.places.request.NearbySearchRequest.java
com.tigerpenguin.places.request.PlaceDetailRequestTest.java
com.tigerpenguin.places.request.PlaceDetailRequest.java
com.tigerpenguin.places.request.PlaceSearchRequestTest.java
com.tigerpenguin.places.request.PlaceSearchRequest.java
com.tigerpenguin.places.request.PlacesRequestTest.java
com.tigerpenguin.places.request.PlacesRequest.java
com.tigerpenguin.places.request.RequestTest.java
com.tigerpenguin.places.response.NearbySearchResponseFactory.java
com.tigerpenguin.places.response.NearbySearchResponse.java
com.tigerpenguin.places.response.PlaceDetailResponseFactory.java
com.tigerpenguin.places.response.PlaceDetailResponse.java
com.tigerpenguin.places.response.PlaceSearchResponse.java
com.tigerpenguin.places.response.PlacesResponseFactory.java
com.tigerpenguin.places.response.PlacesResponse.java
com.tigerpenguin.places.responsehandler.NearbySearchHandlerFragment.java
com.tigerpenguin.places.responsehandler.PlaceDetailResponseHandlerFragment.java
com.tigerpenguin.places.responsehandler.PlacesResponseHandler.java
com.tigerpenguin.widget.simpleratingbar.MockAttributes.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBarAttributes.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBarTest.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBar.java