public class PojoGenerator extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
PojoGenerator.Attribute |
static class |
PojoGenerator.PojoConfiguration |
static class |
PojoGenerator.Ref |
Modifier and Type | Field and Description |
---|---|
protected List<PojoGenerator.Attribute> |
attributes |
private PojoGenerator.PojoConfiguration |
configuration |
protected Set<String> |
imports |
private boolean |
isEnum |
protected Map<String,String> |
nested |
Constructor and Description |
---|
PojoGenerator(PojoGenerator.PojoConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
protected String |
afterClassName() |
protected String |
afterEnumName(Map<String,String> values,
boolean valuesAreInjected) |
protected String |
asType(String javaName,
javax.json.JsonObject schema,
boolean required) |
protected String |
beforeClassDeclaration() |
protected String |
beforeClassEnd() |
protected String |
beforeEnumDeclaration() |
protected String |
beforeEnumEnd() |
private void |
doEnum(javax.json.JsonValue enumList,
String className) |
protected String |
enumImports() |
protected String |
enumName(String javaName,
javax.json.JsonObject schema) |
Map<String,String> |
generate() |
private static <T> T |
getValueAs(javax.json.JsonObject schema,
String attribute,
Class<T> type) |
protected boolean |
isReserved(String name) |
protected PojoGenerator |
newSubPojoGenerator(PojoGenerator.PojoConfiguration pojoConfiguration,
javax.json.JsonObject schema) |
protected String |
onEnum(String javaName,
javax.json.JsonValue enumList,
javax.json.JsonObject schema) |
protected String |
onItemSchema(String javaName,
javax.json.JsonObject schema) |
protected String |
onObjectAttribute(String javaName,
javax.json.JsonObject schema) |
protected String |
onRef(PojoGenerator.Ref ref) |
PojoGenerator |
setNested(Map<String,String> nested) |
protected String |
toCamelCase(String name) |
protected String |
toJavaName(String key) |
private static <T> T |
valueAs(javax.json.JsonObject schema,
Class<T> type,
javax.json.JsonValue value) |
PojoGenerator |
visitSchema(javax.json.JsonObject schema) |
private final PojoGenerator.PojoConfiguration configuration
protected final List<PojoGenerator.Attribute> attributes
private boolean isEnum
public PojoGenerator(PojoGenerator.PojoConfiguration configuration)
public PojoGenerator setNested(Map<String,String> nested)
public PojoGenerator visitSchema(javax.json.JsonObject schema)
protected String onRef(PojoGenerator.Ref ref)
ref
- the reference to resolve.protected String beforeEnumEnd()
protected String beforeClassEnd()
protected String afterClassName()
protected String afterEnumName(Map<String,String> values, boolean valuesAreInjected)
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)protected String enumImports()
protected String beforeEnumDeclaration()
protected String beforeClassDeclaration()
protected String onEnum(String javaName, javax.json.JsonValue enumList, javax.json.JsonObject schema)
private void doEnum(javax.json.JsonValue enumList, String className)
protected PojoGenerator newSubPojoGenerator(PojoGenerator.PojoConfiguration pojoConfiguration, javax.json.JsonObject schema)
protected boolean isReserved(String name)
private static <T> T getValueAs(javax.json.JsonObject schema, String attribute, Class<T> type)
private static <T> T valueAs(javax.json.JsonObject schema, Class<T> type, javax.json.JsonValue value)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.