Package com.atlan.generators
Class GeneratorConfig
java.lang.Object
com.atlan.generators.GeneratorConfig
Class to encapsulate configuration for the generators.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Configuration for generating using local directory for templates.creator
(Class<?> generatorClass, File directoryForTemplateLoading, String packageRoot, String projectName) Configuration for generating using local directory for templates.Configuration for generating using embedded templates in a jar file.boolean
forceNonAbstract
(String originalName) Whether to force the creation of a concrete (non-abstract) POJO class for the given type definition.getDefault
(Class<?> generatorClass) Get the default configuration for the out-of-the-box Atlan model and SDK.getDefault
(Class<?> generatorClass, String projectName) Get the default configuration for the out-of-the-box Atlan model and SDK.freemarker.template.Configuration
boolean
getSearchableRelationship
(String field) Retrieve the relationship type name for any searchable relationship (will be a limited set of the overall relationships).boolean
includeTypedef
(TypeDef typeDef) Whether to generate information for the given type definition.resolveAttributeName
(String originalName) Resolve the provided name to an attribute name, renaming it if configured and otherwise just lowerCamelCasing the name.resolveAttributeToEnumeration
(String originalName) Resolve the type of the attribute to a manually-maintained enumeration, if configured, or return null if there is no enumeration for this attribute.resolveAttributeToTypeOverride
(String typeName, String attributeName) Resolve the type of the attribute to an overridden type, if configured, or return null if there is no type override for this attribute.resolveClassName
(String originalName) Resolve the provided name to a class name, renaming it if configured and otherwise just UpperCamelCasing the name.resolveEnumValue
(String value) Resolve the enumeration value to an all-caps underscored form to meet Java conventions.resolveSingular
(String originalName) Resolve the attribute to a singular form of it for use with builders (Lombok).
-
Method Details
-
creator
public static GeneratorConfig.GeneratorConfigBuilder creator(Class<?> generatorClass, String packageRoot) throws IOException Configuration for generating using embedded templates in a jar file.- Parameters:
generatorClass
- top-level class that is used to generate the codepackageRoot
- root Java package location for the generated models- Throws:
IOException
- if there is any problem configuring the templates through the classloader
-
creator
public static GeneratorConfig.GeneratorConfigBuilder creator(Class<?> generatorClass, File directoryForTemplateLoading, String packageRoot) throws IOException Configuration for generating using local directory for templates.- Parameters:
generatorClass
- top-level class that is used to generate the codedirectoryForTemplateLoading
- directory containing the Freemarker templatespackageRoot
- root Java package location for the generated models- Throws:
IOException
- if the directory cannot be accessed
-
creator
public static GeneratorConfig.GeneratorConfigBuilder creator(Class<?> generatorClass, File directoryForTemplateLoading, String packageRoot, String projectName) throws IOException Configuration for generating using local directory for templates.- Parameters:
generatorClass
- top-level class that is used to generate the codedirectoryForTemplateLoading
- directory containing the Freemarker templatespackageRoot
- root Java package location for the generated modelsprojectName
- (optional) project name for multi-project builds- Throws:
IOException
- if the directory cannot be accessed
-
getDefault
public static GeneratorConfig.GeneratorConfigBuilder getDefault(Class<?> generatorClass) throws IOException Get the default configuration for the out-of-the-box Atlan model and SDK.- Parameters:
generatorClass
- top-level class that is used to generate the code- Returns:
- default configuration
- Throws:
IOException
- if there is any problem configuring the templates through the classloader
-
getDefault
public static GeneratorConfig.GeneratorConfigBuilder getDefault(Class<?> generatorClass, String projectName) throws IOException Get the default configuration for the out-of-the-box Atlan model and SDK.- Parameters:
generatorClass
- top-level class that is used to generate the codeprojectName
- (optional) project name, for multi-project builds- Returns:
- default configuration
- Throws:
IOException
- if there is any problem configuring the templates through the classloader
-
includeTypedef
Whether to generate information for the given type definition.- Parameters:
typeDef
- type definition to consider for inclusion- Returns:
- true if information should be generated for this typedef, otherwise false
-
resolveClassName
Resolve the provided name to a class name, renaming it if configured and otherwise just UpperCamelCasing the name.- Parameters:
originalName
- unmodified name of the type definition- Returns:
- the resolved name for the POJO class for the type's model
-
forceNonAbstract
Whether to force the creation of a concrete (non-abstract) POJO class for the given type definition.- Parameters:
originalName
- unmodified name of the type definition- Returns:
- true if a concrete (non-abstract) POJO should be generated for the type definition
-
resolveAttributeName
Resolve the provided name to an attribute name, renaming it if configured and otherwise just lowerCamelCasing the name.- Parameters:
originalName
- unmodified name of the attribute definition- Returns:
- the resolved name for the attribute in the POJO
-
resolveAttributeToEnumeration
Resolve the type of the attribute to a manually-maintained enumeration, if configured, or return null if there is no enumeration for this attribute.- Parameters:
originalName
- unmodified name of the attribute definition- Returns:
- the resolved enumeration name for the attribute in the POJO, or null if not referring to an enumeration
-
resolveAttributeToTypeOverride
Resolve the type of the attribute to an overridden type, if configured, or return null if there is no type override for this attribute.- Parameters:
typeName
- unmodified name of the typeattributeName
- unmodified name of the attribute definition- Returns:
- the resolved type override for the POJO, or null if no override
-
resolveSingular
Resolve the attribute to a singular form of it for use with builders (Lombok).- Parameters:
originalName
- unmodified name of the attribute definition- Returns:
- the resolved singular form of the word, or an empty string if Lombok can auto-singularize it
-
resolveEnumValue
Resolve the enumeration value to an all-caps underscored form to meet Java conventions.- Parameters:
value
- unmodified value of the enumeration- Returns:
- the unique name for the enumeration matching Java conventions
-
getSearchableRelationship
Retrieve the relationship type name for any searchable relationship (will be a limited set of the overall relationships).- Parameters:
field
- name of the relationship attribute in Atlan- Returns:
- the relationship type name, if the attribute is searchable, otherwise null
-
builder
-
getFreemarkerConfig
public freemarker.template.Configuration getFreemarkerConfig() -
getPackageRoot
-
getPackagePath
-
getTestPath
-
getGeneratorName
-
getPreferTypeDefDescriptions
public boolean getPreferTypeDefDescriptions()
-