T - the concrete type of the generated JSON SchemaB - the concrete type of the JSON Schema builderpublic abstract class AbstractJsonSchema<T,B> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static io.sundr.codegen.model.TypeDef |
BOOLEAN |
protected static io.sundr.codegen.model.TypeRef |
BOOLEAN_REF |
protected static io.sundr.codegen.model.TypeDef |
DATE |
protected static io.sundr.codegen.model.TypeRef |
DATE_REF |
protected static io.sundr.codegen.model.TypeDef |
DOUBLE |
protected static io.sundr.codegen.model.TypeRef |
DOUBLE_REF |
protected static io.sundr.codegen.model.TypeDef |
DURATION |
protected static io.sundr.codegen.model.TypeRef |
DURATION_REF |
protected static io.sundr.codegen.model.TypeDef |
INT |
protected static io.sundr.codegen.model.TypeDef |
INT_OR_STRING |
protected static io.sundr.codegen.model.TypeRef |
INT_OR_STRING_REF |
protected static io.sundr.codegen.model.TypeRef |
INT_REF |
protected static io.sundr.codegen.model.TypeDef |
LONG |
protected static io.sundr.codegen.model.TypeRef |
LONG_REF |
protected static io.sundr.codegen.model.TypeRef |
P_BOOLEAN_REF |
protected static io.sundr.codegen.model.TypeRef |
P_DOUBLE_REF |
protected static io.sundr.codegen.model.TypeRef |
P_INT_REF |
protected static io.sundr.codegen.model.TypeRef |
P_LONG_REF |
protected static io.sundr.codegen.model.TypeDef |
QUANTITY |
protected static io.sundr.codegen.model.TypeRef |
QUANTITY_REF |
protected static io.sundr.codegen.model.TypeDef |
STRING |
protected static io.sundr.codegen.model.TypeRef |
STRING_REF |
| Constructor and Description |
|---|
AbstractJsonSchema() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addProperty(io.sundr.codegen.model.Property property,
B builder,
T schema)
Adds the specified property to the specified builder, calling
internalFrom(TypeRef)
to create the property schema. |
abstract T |
build(B builder,
List<String> required)
Finishes up the process by actually building the final JSON schema based on the provided
builder and a potentially empty list of names of fields which should be marked as required
|
protected abstract T |
collectionProperty(T schema)
Builds the schema for collection properties
|
protected abstract T |
enumProperty(com.fasterxml.jackson.databind.JsonNode... enumValues) |
static String |
getSchemaTypeFor(io.sundr.codegen.model.TypeRef typeRef) |
protected T |
internalFrom(io.sundr.codegen.model.TypeDef definition,
String... ignore)
Creates the JSON schema for the particular
TypeDef. |
T |
internalFrom(io.sundr.codegen.model.TypeRef typeRef)
Builds the specific JSON schema representing the structural schema for the specified property
|
protected abstract T |
mappedProperty(io.sundr.codegen.model.TypeRef ref)
Builds the schema for specifically handled property types (e.g.
|
abstract B |
newBuilder()
Creates a new specific builder object.
|
protected abstract T |
singleProperty(String typeName)
Builds the schema for standard, simple (e.g.
|
protected static final io.sundr.codegen.model.TypeDef QUANTITY
protected static final io.sundr.codegen.model.TypeDef DURATION
protected static final io.sundr.codegen.model.TypeDef INT_OR_STRING
protected static final io.sundr.codegen.model.TypeDef BOOLEAN
protected static final io.sundr.codegen.model.TypeDef STRING
protected static final io.sundr.codegen.model.TypeDef INT
protected static final io.sundr.codegen.model.TypeDef LONG
protected static final io.sundr.codegen.model.TypeDef DOUBLE
protected static final io.sundr.codegen.model.TypeDef DATE
protected static final io.sundr.codegen.model.TypeRef QUANTITY_REF
protected static final io.sundr.codegen.model.TypeRef DURATION_REF
protected static final io.sundr.codegen.model.TypeRef INT_OR_STRING_REF
protected static final io.sundr.codegen.model.TypeRef BOOLEAN_REF
protected static final io.sundr.codegen.model.TypeRef STRING_REF
protected static final io.sundr.codegen.model.TypeRef INT_REF
protected static final io.sundr.codegen.model.TypeRef LONG_REF
protected static final io.sundr.codegen.model.TypeRef DOUBLE_REF
protected static final io.sundr.codegen.model.TypeRef DATE_REF
protected static final io.sundr.codegen.model.TypeRef P_INT_REF
protected static final io.sundr.codegen.model.TypeRef P_LONG_REF
protected static final io.sundr.codegen.model.TypeRef P_DOUBLE_REF
protected static final io.sundr.codegen.model.TypeRef P_BOOLEAN_REF
public static String getSchemaTypeFor(io.sundr.codegen.model.TypeRef typeRef)
protected T internalFrom(io.sundr.codegen.model.TypeDef definition, String... ignore)
TypeDef. This is template method where
sub-classes are supposed to provide specific implementations of abstract methods.definition - The definition.ignore - a potentially empty list of property names to ignore while generating the schemapublic abstract B newBuilder()
public abstract void addProperty(io.sundr.codegen.model.Property property,
B builder,
T schema)
internalFrom(TypeRef)
to create the property schema.property - the property to add to the currently being built schemabuilder - the builder representing the schema being builtschema - the built schema for the property being addedpublic abstract T build(B builder, List<String> required)
builder - the builder used to build the final schemarequired - the list of names of required fieldspublic T internalFrom(io.sundr.codegen.model.TypeRef typeRef)
typeRef - the type of the property which schema we want to buildprotected abstract T mappedProperty(io.sundr.codegen.model.TypeRef ref)
ref - the type of the specifically handled propertyprotected abstract T collectionProperty(T schema)
schema - the schema for the extracted element type for this collection-like propertyprotected abstract T singleProperty(String typeName)
typeName - the mapped name of the property typeprotected abstract T enumProperty(com.fasterxml.jackson.databind.JsonNode... enumValues)
Copyright © 2015–2022 Red Hat. All rights reserved.