Class PojoGenerator
java.lang.Object
org.apache.johnzon.jsonschema.generator.PojoGenerator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<PojoGenerator.Attribute>private final PojoGenerator.PojoConfigurationprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected StringafterEnumName(Map<String, String> values, boolean valuesAreInjected) protected Stringprotected Stringprotected Stringprotected Stringprotected Stringprivate voidprotected Stringprotected Stringgenerate()private static <T> TgetValueAs(jakarta.json.JsonObject schema, String attribute, Class<T> type) protected booleanisReserved(String name) protected PojoGeneratornewSubPojoGenerator(PojoGenerator.PojoConfiguration pojoConfiguration, jakarta.json.JsonObject schema) protected Stringprotected StringonItemSchema(String javaName, jakarta.json.JsonObject schema) protected StringonObjectAttribute(String javaName, jakarta.json.JsonObject schema) protected StringonRef(PojoGenerator.Ref ref) protected StringtoCamelCase(String name) protected StringtoJavaName(String key) private static <T> TvisitSchema(jakarta.json.JsonObject schema)
-
Field Details
-
configuration
-
imports
-
attributes
-
nested
-
isEnum
private boolean isEnum
-
-
Constructor Details
-
PojoGenerator
-
-
Method Details
-
setNested
-
generate
-
visitSchema
-
onRef
- Parameters:
ref- the reference to resolve.- Returns:
- the reference class name if resolved else null.
-
beforeEnumEnd
-
beforeClassEnd
-
afterClassName
-
afterEnumName
- Parameters:
values- the enum values (key is json name, value is java name).valuesAreInjected- is there a toString() with json name or is the enum anemic (only values, no method)- Returns:
- the data to add after enum name and before the opening brace in enum declaration.
-
enumImports
-
beforeEnumDeclaration
-
beforeClassDeclaration
-
asType
-
onEnum
-
doEnum
-
enumName
-
onObjectAttribute
-
newSubPojoGenerator
protected PojoGenerator newSubPojoGenerator(PojoGenerator.PojoConfiguration pojoConfiguration, jakarta.json.JsonObject schema) -
onItemSchema
-
toJavaName
-
toCamelCase
-
isReserved
-
getValueAs
-
valueAs
private static <T> T valueAs(jakarta.json.JsonObject schema, Class<T> type, jakarta.json.JsonValue value)
-