Skip to content
프로젝트

소개

애너테이션을 사용해 Gson 모델을 자동 생성하는 라이브러리

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

JsonAnnotation

JsonAnnotation can speed up Android development.
It generates gson model class by json string automatically and lets you concentrate on what's really important.

Demo

1.Copy url and json string into JsonAnnotation

2.Just write a jsonModel name

3.Build the project
(->Make Project)

Then you can use UserInfo to do something~

GIF Demo
Picture is big,wait a minute...

Usage

1.Add apt in project's build.gradle
[apt][https://bitbucket.org/hvisser/android-apt]

	dependencies {
    	//...
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.7'
    }

2.Add apt plugin below apply plugin: 'com.android.application'

apply plugin: 'android-apt'

3.add jsonAnnotation.jar in lib

Download Jar:https://github.com/tianzhijiexian/JsonAnnotation/blob/master/lib/build/libs/lib.jar

Question

@Json2Model(modelName = "UserInfo",jsonStr = "{\n"
            + "    \"id\": 100,\n"
            + "    \"body\": \"It is my post\",\n"
            + "    \"number\": 0.13,\n"
            + "    \"created_at\": \"2014-05-22 19:12:38\"\n"
            + "}")
    String SEARCH_URSER_INFO = "search/user"; // api url

1. Why we need build project?
Unfortunately,Android does not(yet)understand the concept of a compile-time-only dependency, so you need to mess with your build files to make it work.

2. Efficiency
@Json2Model will run in compile-time and models are created before generate apk file.Using JsonAnnotation,developers can let it generate the plumbing code at compile time.Reflect is not in this project,you needn't worry about efficiency questions.

3. Where are models
@Json2Model will create models is out of your own project.You can find theme in:
app(your model name)/build/generated/source/apt/debug/...

You should edit these models by edit your jsonString.

JsonAnnotation is less than 40kb,try it now~

similar project: [https://projectlombok.org/]

Developer


Jack Tony: [email protected]

zzz40500: [email protected]

License

Copyright 2015 Jack Tony

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.

관련 프로젝트 살펴보기

불러오는 중…