Package cn.net.pap.common.jsonorm.util
Class JsonSchemaGeneratorUtil
java.lang.Object
cn.net.pap.common.jsonorm.util.JsonSchemaGeneratorUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertJsonToJsonSchema(String jsonString) 将 JSON 字符串转换为 JSON SchemaflattenJson(String json) 将 JSON 字符串转换为平铺的 Liststatic StringgenerateJsonFromSchema(String jsonSchema) 根据 JSON Schema 字符串生成 JSON 数据static StringunflattenJson(List<String> flatList) 将平铺的 List转换为嵌套的 JSON 字符串
-
Constructor Details
-
JsonSchemaGeneratorUtil
public JsonSchemaGeneratorUtil()
-
-
Method Details
-
convertJsonToJsonSchema
将 JSON 字符串转换为 JSON Schema- Parameters:
jsonString- JSON 字符串- Returns:
- JSON Schema 字符串
- Throws:
IOException
-
generateJsonFromSchema
根据 JSON Schema 字符串生成 JSON 数据- Parameters:
jsonSchema- JSON Schema 字符串- Returns:
- 生成的 JSON 字符串
- Throws:
IOException
-
flattenJson
将 JSON 字符串转换为平铺的 List- Parameters:
json- 输入的 JSON 字符串- Returns:
- 平铺后的字段路径列表
- Throws:
IOException
-
unflattenJson
将平铺的 List转换为嵌套的 JSON 字符串 - Parameters:
flatList- 平铺的字段列表- Returns:
- 嵌套的 JSON 字符串
- Throws:
IOException
-