https://github.com/tagaryen/archer-xjson
json parser util
https://github.com/tagaryen/archer-xjson
json json-parser serialization
Last synced: 12 months ago
JSON representation
json parser util
- Host: GitHub
- URL: https://github.com/tagaryen/archer-xjson
- Owner: tagaryen
- License: apache-2.0
- Created: 2024-12-04T01:28:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-15T07:02:01.000Z (12 months ago)
- Last Synced: 2025-07-15T16:37:40.572Z (12 months ago)
- Topics: json, json-parser, serialization
- Language: Java
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# archer-xjson
json library written with pure java
maven:
```maven
io.github.tagaryen
archer-xjson
1.1.8
```
## examples
``` java
public class TestObj {
boolean ret;
char c;
byte b;
int code;
float money;
String msg;
LocalDateTime t;
List> list;
List strs;
BigInteger bigA;
BigDecimal bigB;
public TestObj() {
}
public TestObj(boolean hasList) {
c = 'w';
b = 10;
code = 100;
money = 123.4f;
msg = "mm\"} \"mss";
ret = true;
t = LocalDateTime.now();
if(hasList) {
Queue queue = new ArrayBlockingQueue<>(2);
queue.add(new TestObj(false));
queue.add(new TestObj(false));
list = Arrays.asList(queue);
}
bigA = BigInteger.valueOf(1824683462834l);
bigB = BigDecimal.valueOf(172714.124d);
}
public boolean isRet() {
return ret;
}
public void setRet(boolean ret) {
this.ret = ret;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public float getMoney() {
return money;
}
public void setMoney(float money) {
this.money = money;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public LocalDateTime getT() {
return t;
}
public void setT(LocalDateTime t) {
this.t = t;
}
public List> getList() {
return list;
}
public void setList(List> list) {
this.list = list;
}
public BigInteger getBigA() {
return bigA;
}
public void setBigA(BigInteger bigA) {
this.bigA = bigA;
}
public BigDecimal getBigB() {
return bigB;
}
public void setBigB(BigDecimal bigB) {
this.bigB = bigB;
}
}
// test
Map map = new HashMap<>();
map.put("the", new TestObj(true));
String bjson = XJSONStatic.stringify(map);
System.out.println(bjson);
Map parsed = XJSONStatic.parse(bjson, new JavaTypeRef>() {});
System.out.println(parsed.get("the").msg);
```