Package io.fabric8.crd.generator.v1beta1
Class JsonSchema
- java.lang.Object
-
- io.fabric8.crd.generator.AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
-
- io.fabric8.crd.generator.v1beta1.JsonSchema
-
public class JsonSchema extends AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
-
-
Field Summary
Fields Modifier and Type Field Description static io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsJSON_SCHEMA_INT_OR_STRING-
Fields inherited from class io.fabric8.crd.generator.AbstractJsonSchema
BOOLEAN, BOOLEAN_REF, COMMON_MAPPINGS, DATE, DATE_REF, DOUBLE, DOUBLE_REF, DURATION, DURATION_REF, INT, INT_OR_STRING, INT_OR_STRING_REF, INT_REF, LONG, LONG_REF, P_BOOLEAN_REF, P_DOUBLE_REF, P_INT_REF, P_LONG_REF, QUANTITY, QUANTITY_REF, STRING, STRING_REF
-
-
Constructor Summary
Constructors Constructor Description JsonSchema()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(io.sundr.codegen.model.Property property, io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder builder, io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps schema)Adds the specified property to the specified builder, callingAbstractJsonSchema.internalFrom(TypeRef)to create the property schema.io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsbuild(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder 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 requiredprotected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropscollectionProperty(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps schema)Builds the schema for collection propertiesprotected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsenumProperty(com.fasterxml.jackson.databind.JsonNode... enumValues)static io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsfrom(io.sundr.codegen.model.TypeDef definition, String... ignore)Creates the JSON schema for the particularTypeDef.protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsmappedProperty(io.sundr.codegen.model.TypeRef ref)Builds the schema for specifically handled property types (e.g.io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuildernewBuilder()Creates a new specific builder object.protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropssingleProperty(String typeName)Builds the schema for standard, simple (e.g.-
Methods inherited from class io.fabric8.crd.generator.AbstractJsonSchema
internalFrom, internalFrom
-
-
-
-
Method Detail
-
from
public static io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps from(io.sundr.codegen.model.TypeDef definition, String... ignore)Creates the JSON schema for the particularTypeDef.- Parameters:
definition- The definition.ignore- an optional list of property names to ignore- Returns:
- The schema.
-
newBuilder
public io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder newBuilder()
Description copied from class:AbstractJsonSchemaCreates a new specific builder object.- Specified by:
newBuilderin classAbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>- Returns:
- a new builder object specific to the CRD generation version
-
addProperty
public void addProperty(io.sundr.codegen.model.Property property, io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder builder, io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps schema)Description copied from class:AbstractJsonSchemaAdds the specified property to the specified builder, callingAbstractJsonSchema.internalFrom(TypeRef)to create the property schema.- Specified by:
addPropertyin classAbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>- Parameters:
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 added
-
build
public io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps build(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder builder, List<String> required)Description copied from class:AbstractJsonSchemaFinishes 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- Specified by:
buildin classAbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>- Parameters:
builder- the builder used to build the final schemarequired- the list of names of required fields- Returns:
- the built JSON schema
-
collectionProperty
protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps collectionProperty(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps schema)
Description copied from class:AbstractJsonSchemaBuilds the schema for collection properties- Specified by:
collectionPropertyin classAbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>- Parameters:
schema- the schema for the extracted element type for this collection-like property- Returns:
- the schema for the collection-like property
-
singleProperty
protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps singleProperty(String typeName)
Description copied from class:AbstractJsonSchemaBuilds the schema for standard, simple (e.g. string) property types- Specified by:
singlePropertyin classAbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>- Parameters:
typeName- the mapped name of the property type- Returns:
- the schema for the property
-
mappedProperty
protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps mappedProperty(io.sundr.codegen.model.TypeRef ref)
Description copied from class:AbstractJsonSchemaBuilds the schema for specifically handled property types (e.g. intOrString properties)- Specified by:
mappedPropertyin classAbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>- Parameters:
ref- the type of the specifically handled property- Returns:
- the property schema
-
enumProperty
protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps enumProperty(com.fasterxml.jackson.databind.JsonNode... enumValues)
- Specified by:
enumPropertyin classAbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
-
-