configuration-0.1.0

Simple configuration framework based on Apache Common Configuration.

Лицензия

Лицензия

Категории

Категории

Сеть Configuration Библиотеки уровня приложения config
Группа

Группа

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

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

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

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

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

configuration-0.1.0
Simple configuration framework based on Apache Common Configuration.
Ссылка на сайт

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

http://kut3.net/configuration

Скачать configuration

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

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

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.apache.commons : commons-configuration2 jar 2.4

runtime (1)

Идентификатор библиотеки Тип Версия
commons-beanutils : commons-beanutils jar 1.9.3

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

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

JSON

Maven dependency

<dependency>
   <groupId>net.kut3</groupId>
   <artifactId>json</artifactId>
   <version>0.2.0</version>
</dependency>

Usage

Parsing from a JSON string

You should know exactly the JSON string is a JsonObject or a JsonArray.

// JsonObject   
JsonObject jo = JsonObject.parse("{...}");`  

// JsonArray  
JsonArray ja = JsonArray.parse("[...]");`   

Create new

// JsonObject   
JsonObject jo = new JsonObject();`

// JsonArray  
JsonArray ja = new JsonArray();`

Adapter for Gson

From v0.2.0 and upper

// JsonObject
com.google.gson.JsonObject gsonObj 
            = new com.google.gson.JsonObject();
    
JsonObject jo = new JsonObject(gsonObj);
    

// JsonArray
com.google.gson.JsonArray gsonArr
            = new com.google.gson.JsonArray();
            
JsonArray ja = new JsonArray(gsonArr);

Get and set

  • Use getXXX(String fieldName) methods to get the value of one field.
  • Use set(String fieldName, XXX fieldValue) to set value for a field (upsert)

To Json string

  • Use toString() method.

Loop

  • Use foreach(...) method to iterate fields of a JsonObject or items of a JsonArray.

Get size and empty checking

  • Use size() and isEmpty() methods.

Get all field names of a JsonObject

From v0.2.0 and upper

jo.fieldNames()

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

Версия
0.1.0