address-formatter-java

A simple address-formatter-java.

Лицензия

Лицензия

Категории

Категории

Java Языки программирования Сеть ORM Данные
Группа

Группа

net.placemarkt
Идентификатор

Идентификатор

address-formatter-java
Последняя версия

Последняя версия

0.0.9
Дата

Дата

Тип

Тип

jar
Описание

Описание

address-formatter-java
A simple address-formatter-java.
Ссылка на сайт

Ссылка на сайт

http://placemarkt.net
Система контроля версий

Система контроля версий

https://github.com/placemarkt/address-formatter-java

Скачать address-formatter-java

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.placemarkt/address-formatter-java/ -->
<dependency>
    <groupId>net.placemarkt</groupId>
    <artifactId>address-formatter-java</artifactId>
    <version>0.0.9</version>
</dependency>
// https://jarcasting.com/artifacts/net.placemarkt/address-formatter-java/
implementation 'net.placemarkt:address-formatter-java:0.0.9'
// https://jarcasting.com/artifacts/net.placemarkt/address-formatter-java/
implementation ("net.placemarkt:address-formatter-java:0.0.9")
'net.placemarkt:address-formatter-java:jar:0.0.9'
<dependency org="net.placemarkt" name="address-formatter-java" rev="0.0.9">
  <artifact name="address-formatter-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.placemarkt', module='address-formatter-java', version='0.0.9')
)
libraryDependencies += "net.placemarkt" % "address-formatter-java" % "0.0.9"
[net.placemarkt/address-formatter-java "0.0.9"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.13
com.fasterxml.jackson.core : jackson-core jar 2.11.3
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.11.3
com.google.guava : guava jar 30.0-jre
com.github.spullara.mustache.java : compiler jar 0.9.7

Модули Проекта

Данный проект не имеет модулей.

Address Formatter

Overview

A Maven package for formatting data in the OpenStreetMaps address field generated by the Nominatim API. This project was only possible thanks to the amazing OpenCage team, who did the work of collating the postal address formats upon which this library relies.

For Java 8 and above.

Installation

Add the following to your pom.xml to use the latest release with Maven:

<dependency>
  <groupId>net.placemarkt</groupId>
  <artifactId>address-formatter-java</artifactId>
  <version>0.0.9</version>
</dependency> 

API

// Constructor
AddressFormatter(Boolean abbreviate, Boolean appendCountry)

// Methods
format(String json)
format(String json, String fallbackCountryCode)

Use

AddressFormatter formatter = new AddressFormatter(false, false);
String json = "{country_code: 'US',\n"
          + "house_number: '301',\n"
          + "road: 'Hamilton Avenue',\n"
          + "neighbourhood: 'Crescent Park',\n"
          + "city: 'Palo Alto',\n"
          + "postcode: '94303',\n"
          + "county: 'Santa Clara County',\n"
          + "state: 'California',\n"
          + "country: 'United States',}";
String formatted = formatter.format(json);
/*
301 Hamilton Avenue
Palo Alto, CA 94303
United States of America
*/

AddressFormatter abbreviateFormatter = new AddressFormatter(true, false);
String json = "{country_code: 'US',\n"
          + "house_number: '301',\n"
          + "road: 'Hamilton Avenue',\n"
          + "neighbourhood: 'Crescent Park',\n"
          + "city: 'Palo Alto',\n"
          + "postcode: '94303',\n"
          + "county: 'Santa Clara County',\n"
          + "state: 'California',\n"
          + "country: 'United States',}";
String formatted = abbreviateFormatter.format(json);
/*
301 Hamilton Ave
Palo Alto, CA 94303
United States of America
*/

AddressFormatter appendCountryFormatter = new AddressFormatter(false, true);
String json = "{country_code: 'US',\n"
          + "house_number: '301',\n"
          + "road: 'Hamilton Avenue',\n"
          + "neighbourhood: 'Crescent Park',\n"
          + "city: 'Palo Alto',\n"
          + "postcode: '94303',\n"
          + "county: 'Santa Clara County',\n"
          + "state: 'California',}"
String formatted = appendCountryFormatter.format(json);
/*
301 Hamilton Ave
Palo Alto, CA 94303
United States of America
*/

License

This project is licensed under the MIT License. See the LICENSE for details.

Contributions

Contributions welcome. Be nice.

Acknowledgements

net.placemarkt

Placemarkt

Location bookmarking for your favorite places

Версии библиотеки

Версия
0.0.9