This commit is contained in:
redkale
2023-10-05 21:53:40 +08:00
parent a71544a78d
commit 61e2cc16ad
3 changed files with 9 additions and 1 deletions

View File

@@ -42,6 +42,10 @@ public class JsonArray extends ArrayList<Object> implements JsonElement {
return JsonConvert.root().convertFrom(JsonArray.class, text, offset, length);
}
public static JsonArray create() {
return new JsonArray();
}
public JsonArray append(Object value) {
super.add(value);
return this;

View File

@@ -38,6 +38,10 @@ public class JsonObject extends LinkedHashMap<String, Object> implements JsonEle
return JsonConvert.root().convertFrom(JsonObject.class, text, offset, length);
}
public static JsonObject create() {
return new JsonObject();
}
public static JsonObject of(Object bean) {
if (bean instanceof CharSequence) {
return convertFrom(bean.toString());

View File

@@ -23,7 +23,7 @@ import org.redkale.convert.ConvertType;
@Retention(RUNTIME)
public @interface ResourceProducer {
String mq();
String mq() default "";
boolean required() default true;