Class JsonSchemaBeanGenerator
java.lang.Object
org.apache.juneau.bean.jsonschema.JsonSchemaBeanGenerator
Bridge for generating typed
JsonSchema beans from Java types.
JsonSchemaGenerator in
Example:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a new builder.JsonSchema<?>Generates a schema bean from a Java class.JsonSchema<?>Generates a schema bean from an object.JsonSchema<?>Generates a schema bean from a Java type.static JsonSchema<?>Converts a generated schema map into a typed bean.
-
Field Details
-
DEFAULT
Reusable default instance.
-
-
Method Details
-
create
Creates a new builder. -
generate
Generates a schema bean from a Java type.- Parameters:
type- The Java type. Must not benull , or anIllegalArgumentExceptionis thrown.- Returns:
- The generated schema bean, or
null if a schema could not be generated for the type.
-
generate
Generates a schema bean from a Java class.- Parameters:
type- The Java class. Must not benull , or anIllegalArgumentExceptionis thrown.- Returns:
- The generated schema bean, or
null if a schema could not be generated for the class.
-
generate
Generates a schema bean from an object.The value can be a POJO or a
Class /Type .- Parameters:
o- The value to infer a schema from. Must not benull , or anIllegalArgumentExceptionis thrown.- Returns:
- The generated schema bean, or
null if a schema could not be generated for the value.
-
toBean
Converts a generated schema map into a typed bean.Conversion uses a JSON roundtrip to ensure the swaps declared on
JsonSchemaare honored.- Parameters:
schemaMap- The generated schema map. Must not benull , or anIllegalArgumentExceptionis thrown.- Returns:
- The typed schema bean.
-