public final class JsonSchemaHelper extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getPrimitiveType(Class<?> type)
Gets the JSon schema primitive type.
|
static String |
getPropertyDefaultValue(List<Map<String,String>> rows,
String name)
Gets the default value of the property
|
static String |
getPropertyPrefix(List<Map<String,String>> rows,
String name)
Gets the prefix value of the property
|
static String |
getType(Class<?> type)
Gets the JSon schema type.
|
static boolean |
isPropertyMultiValue(List<Map<String,String>> rows,
String name)
Is the property multi valued
|
static boolean |
isPropertyRequired(List<Map<String,String>> rows,
String name)
Is the property required
|
static List<Map<String,String>> |
parseJsonSchema(String group,
String json,
boolean parseProperties)
Parses the json schema to split it into a list or rows, where each row contains key value pairs with the metadata
|
public static String getType(Class<?> type)
type
- the java typepublic static String getPrimitiveType(Class<?> type)
type
- the java typepublic static List<Map<String,String>> parseJsonSchema(String group, String json, boolean parseProperties)
group
- the group to parse from such as component, componentProperties, or properties.json
- the jsonpublic static boolean isPropertyRequired(List<Map<String,String>> rows, String name)
rows
- the rows of propertiesname
- name of the propertypublic static String getPropertyDefaultValue(List<Map<String,String>> rows, String name)
rows
- the rows of propertiesname
- name of the propertypublic static boolean isPropertyMultiValue(List<Map<String,String>> rows, String name)
rows
- the rows of propertiesname
- name of the propertyApache Camel