Package org.jsonschema2pojo.util
Class NameHelper
java.lang.Object
org.jsonschema2pojo.util.NameHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBaseBuilderClassName(com.sun.codemodel.JClass outerClass) getBaseBuilderClassNameSuffix(com.sun.codemodel.JClass outerClass) getBuilderClassName(com.sun.codemodel.JClass outerClass) getBuilderClassNameSuffix(com.sun.codemodel.JClass outerClass) getBuilderName(String propertyName, com.fasterxml.jackson.databind.JsonNode node) Generate builder method name for property (like withXxx).getBuilderTypeParameterName(com.sun.codemodel.JDefinedClass instanceClass) getClassName(String propertyName, com.fasterxml.jackson.databind.JsonNode node) getClassName(String nodeName, com.fasterxml.jackson.databind.JsonNode node, com.sun.codemodel.JPackage _package) getFieldName(String propertyName, com.fasterxml.jackson.databind.JsonNode node) Generate a name for the class field that will hold this property.getGetterName(String propertyName, com.sun.codemodel.JType type, com.fasterxml.jackson.databind.JsonNode node) Generate getter method name for property.getPropertyName(String jsonFieldName, com.fasterxml.jackson.databind.JsonNode node) Convert jsonFieldName into the equivalent Java field name by replacing illegal characters and normalizing it.getSetterName(String propertyName, com.fasterxml.jackson.databind.JsonNode node) Generate setter method name for property.getUniqueClassName(String nodeName, com.fasterxml.jackson.databind.JsonNode node, com.sun.codemodel.JPackage _package) normalizeName(String name)
-
Field Details
-
ILLEGAL_CHARACTER_REGEX
- See Also:
-
-
Constructor Details
-
NameHelper
-
-
Method Details
-
getBuilderTypeParameterName
-
replaceIllegalCharacters
-
normalizeName
-
capitalizeTrailingWords
-
getPropertyName
Convert jsonFieldName into the equivalent Java field name by replacing illegal characters and normalizing it.- Parameters:
jsonFieldName- the name of the JSON propertynode- the JsonNode representing the schema for this property- Returns:
- a safe, appropriate Java field name
-
getSetterName
Generate setter method name for property.- Parameters:
propertyName- the name of the property being setnode- the JsonNode representing the schema for this property- Returns:
- a safe, appropriate name for the Java setter method
-
getBuilderName
Generate builder method name for property (like withXxx).- Parameters:
propertyName- the name of the property being added by this buildernode- the JsonNode representing the schema for this property- Returns:
- a safe, appropriate name for the Java builder method
-
getFieldName
Generate a name for the class field that will hold this property.- Parameters:
propertyName- the name of the JSON property being added as a fieldnode- the JsonNode representing the schema for this property- Returns:
- a safe, appropriate name for the Java class field
-
getClassName
-
getGetterName
public String getGetterName(String propertyName, com.sun.codemodel.JType type, com.fasterxml.jackson.databind.JsonNode node) Generate getter method name for property.- Parameters:
propertyName- the name of the property this getter will returnnode- the JsonNode representing the schema for this property- Returns:
- a safe, appropriate name for the Java getter method
-
getBaseBuilderClassName
-
getBaseBuilderClassNameSuffix
-
getBuilderClassName
-
getBuilderClassNameSuffix
-
getUniqueClassName
-
getClassName
-