public abstract class JsonSchemaGenerator extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
JsonSchemaGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> com.fasterxml.jackson.databind.node.ObjectNode |
checkAndProcessType(Class<T> type,
com.fasterxml.jackson.databind.node.ObjectNode schema)
Checks whether the type is SimpleType (mapped by
SimpleTypeMappings), Collection or Iterable (for mapping arrays),
Void type (returning null), or custom Class (for mapping objects). |
protected com.fasterxml.jackson.databind.node.ObjectNode |
createInstance() |
protected com.fasterxml.jackson.databind.node.ObjectNode |
generatePropertySchema(Method method,
Field field) |
<T> com.fasterxml.jackson.databind.node.ObjectNode |
generateSchema(Class<T> type) |
boolean |
isAutoPutVersion()
Checks if this generator should put the $schema attribute at the root
schema.
|
protected com.fasterxml.jackson.databind.node.ObjectNode |
mergeSchema(com.fasterxml.jackson.databind.node.ObjectNode parent,
com.fasterxml.jackson.databind.node.ObjectNode child,
boolean overwriteChildProperties)
Merges two schemas.
|
protected <T> com.fasterxml.jackson.databind.node.ObjectNode |
mergeWithParent(Class<T> type,
com.fasterxml.jackson.databind.node.ObjectNode schema)
If the Java Type inherits from other Java Type then Object, then it is
assumed to inherit from other custom type.
|
protected void |
overwriteProperty(com.fasterxml.jackson.databind.node.ObjectNode parent,
com.fasterxml.jackson.databind.node.ObjectNode child,
String propertyName) |
protected <T> com.fasterxml.jackson.databind.node.ObjectNode |
processCustomType(Class<T> type,
com.fasterxml.jackson.databind.node.ObjectNode schema)
Generates the schema of custom java types
|
protected <T> void |
processProperties(Class<T> type,
com.fasterxml.jackson.databind.node.ObjectNode schema) |
protected <T> void |
processRootAttributes(Class<T> type,
com.fasterxml.jackson.databind.node.ObjectNode schema) |
protected abstract void |
processSchemaProperty(com.fasterxml.jackson.databind.node.ObjectNode schema,
Attributes props)
Reads
Attributes annotation and put its values into the
generating schema. |
JsonSchemaGenerator |
setAutoPutVersion(boolean autoPutVersion)
If true, this parameter says that the $schema atribute should be put at
the root of all schemas generated by this SchemaGenerator instace.
|
protected abstract void processSchemaProperty(com.fasterxml.jackson.databind.node.ObjectNode schema,
Attributes props)
Attributes annotation and put its values into the
generating schema. Usually, some verification is done for not putting the
default values.schema - props - protected com.fasterxml.jackson.databind.node.ObjectNode createInstance()
public boolean isAutoPutVersion()
public JsonSchemaGenerator setAutoPutVersion(boolean autoPutVersion)
autoPutVersion - public <T> com.fasterxml.jackson.databind.node.ObjectNode generateSchema(Class<T> type)
protected <T> com.fasterxml.jackson.databind.node.ObjectNode checkAndProcessType(Class<T> type, com.fasterxml.jackson.databind.node.ObjectNode schema)
SimpleTypeMappings), Collection or Iterable (for mapping arrays),
Void type (returning null), or custom Class (for mapping objects).type - schema - protected <T> com.fasterxml.jackson.databind.node.ObjectNode processCustomType(Class<T> type, com.fasterxml.jackson.databind.node.ObjectNode schema)
type - schema - protected com.fasterxml.jackson.databind.node.ObjectNode generatePropertySchema(Method method, Field field)
protected <T> void processRootAttributes(Class<T> type, com.fasterxml.jackson.databind.node.ObjectNode schema)
protected <T> void processProperties(Class<T> type, com.fasterxml.jackson.databind.node.ObjectNode schema)
protected <T> com.fasterxml.jackson.databind.node.ObjectNode mergeWithParent(Class<T> type, com.fasterxml.jackson.databind.node.ObjectNode schema)
type - schema - protected com.fasterxml.jackson.databind.node.ObjectNode mergeSchema(com.fasterxml.jackson.databind.node.ObjectNode parent,
com.fasterxml.jackson.databind.node.ObjectNode child,
boolean overwriteChildProperties)
parent - A parent schema considering inheritancechild - A child schema considering inheritanceoverwriteChildProperties - A boolean to check whether properties (from parent or child) must have higher priorityprotected void overwriteProperty(com.fasterxml.jackson.databind.node.ObjectNode parent,
com.fasterxml.jackson.databind.node.ObjectNode child,
String propertyName)
Copyright © 2013 Reinert, Danilo. All Rights Reserved.