- All Known Implementing Classes:
AbstractGeneratorStrategy
,DefaultGeneratorStrategy
,JPrefixGeneratorStrategy
,JVMArgsGeneratorStrategy
,KeepNamesGeneratorStrategy
,MatcherStrategy
public interface GeneratorStrategy
A strategy for naming various artefacts generated from
Definition
's- Author:
- Lukas Eder
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The "mode" by which an artefact should be named -
Method Summary
Modifier and TypeMethodDescriptiongetFile
(Definition definition) getFile
(Definition definition, GeneratorStrategy.Mode mode) getFileHeader
(Definition definition) getFileHeader
(Definition definition, GeneratorStrategy.Mode mode) getFileName
(Definition definition) getFileName
(Definition definition, GeneratorStrategy.Mode mode) getFullJavaClassName
(Definition definition) getFullJavaClassName
(Definition definition, GeneratorStrategy.Mode mode) This is the same as callinggetFullJavaClassName(definition, Mode.DEFAULT)
getFullJavaIdentifier
(Definition definition) This is applied to definitions that can result in reference static and instance members.getFullJavaIdentifiers
(Collection<? extends Definition> definitions) getFullJavaIdentifiers
(Definition... definitions) getGlobalReferencesFile
(Definition container, Class<? extends Definition> objectType) getGlobalReferencesFileHeader
(Definition container, Class<? extends Definition> objectType) getGlobalReferencesFileName
(Definition container, Class<? extends Definition> objectType) getGlobalReferencesFullJavaClassName
(Definition container, Class<? extends Definition> objectType) getGlobalReferencesJavaClassExtends
(Definition container, Class<? extends Definition> objectType) getGlobalReferencesJavaClassImplements
(Definition container, Class<? extends Definition> objectType) getGlobalReferencesJavaClassName
(Definition container, Class<? extends Definition> objectType) getGlobalReferencesJavaPackageName
(Definition container, Class<? extends Definition> objectType) boolean
Whether fields are instance fields (as opposed to static fields)boolean
Whether getters and setters should be generated JavaBeans style (or jOOQ style).getJavaClassExtends
(Definition definition) This is the same as callinggetJavaClassExtends(definition, Mode.DEFAULT)
getJavaClassExtends
(Definition definition, GeneratorStrategy.Mode mode) getJavaClassImplements
(Definition definition) This is the same as callinggetJavaClassImplements(definition, Mode.DEFAULT)
getJavaClassImplements
(Definition definition, GeneratorStrategy.Mode mode) getJavaClassName
(Definition definition) This is the same as callinggetJavaClassName(definition, Mode.DEFAULT)
getJavaClassName
(Definition definition, GeneratorStrategy.Mode mode) getJavaEnumLiteral
(EnumDefinition definition, String literal) This is applied to enum literals of a givenEnumDefinition
.getJavaEnumLiterals
(EnumDefinition definition, String... literals) getJavaEnumLiterals
(EnumDefinition definition, Collection<? extends String> literals) getJavaGetterName
(Definition definition) This is applied to definitions that can result in getters of a container.getJavaGetterName
(Definition definition, GeneratorStrategy.Mode mode) This is applied to definitions that can result in getters of a container.getJavaIdentifier
(Definition definition) This is applied to definitions that can result in reference static and instance members.getJavaIdentifiers
(Collection<? extends Definition> definitions) getJavaIdentifiers
(Definition... definitions) getJavaMemberName
(Definition definition) The "java member name" is applied where a definition is used as a member (for POJOs) or as a method argument (for setters).getJavaMemberName
(Definition definition, GeneratorStrategy.Mode mode) The "java member name" is applied where a definition is used as a member (for POJOs) or as a method argument (for setters).getJavaMethodName
(Definition definition) This is applied to definitions that can result in methods.getJavaMethodName
(Definition definition, GeneratorStrategy.Mode mode) This is applied to definitions that can result in methods.getJavaPackageName
(Definition definition) This is the same as callinggetJavaPackageName(definition, Mode.DEFAULT)
getJavaPackageName
(Definition definition, GeneratorStrategy.Mode mode) getJavaSetterName
(Definition definition) This is applied to definitions that can result in setters of a container.getJavaSetterName
(Definition definition, GeneratorStrategy.Mode mode) This is applied to definitions that can result in setters of a container.getOverloadSuffix
(Definition definition, GeneratorStrategy.Mode mode, String overloadIndex) The target directoryvoid
setInstanceFields
(boolean instanceFields) Whether fields are instance fields (as opposed to static fields)void
setJavaBeansGettersAndSetters
(boolean javaBeansGettersAndSetters) Whether getters and setters should be generated JavaBeans style (or jOOQ style).void
setTargetDirectory
(String directory) Initialise the target directoryvoid
setTargetLanguage
(Language targetLanguage) Initialise the target languagevoid
setTargetLocale
(Locale targetLocale) Initialise the target localevoid
setTargetPackage
(String packageName) Initialise the target package name
-
Method Details
-
getTargetDirectory
String getTargetDirectory()The target directory -
setTargetDirectory
Initialise the target directory -
getTargetPackage
String getTargetPackage()- Returns:
- Get the target package for the current configuration
-
setTargetPackage
Initialise the target package name -
getTargetLocale
Locale getTargetLocale()- Returns:
- Get the target locale for the current configuration
-
setTargetLocale
Initialise the target locale -
getTargetLanguage
Language getTargetLanguage()- Returns:
- Get the target language for the current configuration
-
setTargetLanguage
Initialise the target language -
setInstanceFields
void setInstanceFields(boolean instanceFields) Whether fields are instance fields (as opposed to static fields) -
getInstanceFields
boolean getInstanceFields()Whether fields are instance fields (as opposed to static fields) -
setJavaBeansGettersAndSetters
void setJavaBeansGettersAndSetters(boolean javaBeansGettersAndSetters) Whether getters and setters should be generated JavaBeans style (or jOOQ style). -
getJavaBeansGettersAndSetters
boolean getJavaBeansGettersAndSetters()Whether getters and setters should be generated JavaBeans style (or jOOQ style). -
getJavaEnumLiteral
This is applied to enum literals of a givenEnumDefinition
.- Returns:
- The Java identifier representing this enum literal, e.g. [OK]
-
getJavaEnumLiterals
-
getJavaEnumLiterals
-
getJavaIdentifier
This is applied to definitions that can result in reference static and instance members. For instance, the reference instance of aTableDefinition
is a java identifier- Returns:
- The Java identifier representing this object, e.g. [my_table]
-
getJavaIdentifiers
- See Also:
-
getJavaIdentifiers
- See Also:
-
getFullJavaIdentifier
This is applied to definitions that can result in reference static and instance members. For instance, the reference instance of aTableDefinition
is a java identifier- Returns:
- The Java identifier representing this object, e.g. [my_table]
-
getFullJavaIdentifiers
- See Also:
-
getFullJavaIdentifiers
- See Also:
-
getJavaSetterName
This is applied to definitions that can result in setters of a container. For example, the definition could be aColumnDefinition
, the container aTableDefinition
. Then this would apply to records and POJOs. Also, the definition could be anAttributeDefinition
and the container aUDTDefinition
This is the same as calling
getJavaSetterName(definition, Mode.DEFAULT)
- Returns:
- The Java setter method name representing this object, e.g. [setMyTable]
-
getJavaSetterName
This is applied to definitions that can result in setters of a container. For example, the definition could be aColumnDefinition
, the container aTableDefinition
. Then this would apply to records and POJOs. Also, the definition could be anAttributeDefinition
and the container aUDTDefinition
- Returns:
- The Java setter method name representing this object, e.g. [setMyTable]
-
getJavaGetterName
This is applied to definitions that can result in getters of a container. For example, the definition could be aColumnDefinition
, the container aTableDefinition
. Then this would apply to records and POJOs. Also, the definition could be anAttributeDefinition
and the container aUDTDefinition
This is the same as calling
getJavaGetterName(definition, Mode.DEFAULT)
- Returns:
- The Java getter method name representing this object, e.g. [getMyTable]
-
getJavaGetterName
This is applied to definitions that can result in getters of a container. For example, the definition could be aColumnDefinition
, the container aTableDefinition
. Then this would apply to records and POJOs. Also, the definition could be anAttributeDefinition
and the container aUDTDefinition
- Returns:
- The Java getter method name representing this object, e.g. [getMyTable]
-
getJavaMethodName
This is applied to definitions that can result in methods. For example, the definition could be aRoutineDefinition
This is the same as calling
getJavaMethodName(definition, Mode.DEFAULT)
- Returns:
- The Java method name representing this object, e.g. [myFunction]
-
getJavaMethodName
This is applied to definitions that can result in methods. For example, the definition could be aRoutineDefinition
- Returns:
- The Java method name representing this object, e.g. [myFunction]
-
getGlobalReferencesJavaClassExtends
String getGlobalReferencesJavaClassExtends(Definition container, Class<? extends Definition> objectType) - Returns:
- The super class name of the global references class for a given
definition type, e.g. [com.example.AbstractPojo]. If this returns
null
or an empty string, then no super class is extended.
-
getJavaClassExtends
This is the same as callinggetJavaClassExtends(definition, Mode.DEFAULT)
- Returns:
- The super class name of the Java class representing this object,
e.g. [com.example.AbstractPojo]. If this returns
null
or an empty string, then no super class is extended.
-
getJavaClassExtends
- Returns:
- The super class name of the Java class representing this object,
e.g. [com.example.AbstractPojo]. If this returns
null
or an empty string, then no super class is extended.
-
getGlobalReferencesJavaClassImplements
List<String> getGlobalReferencesJavaClassImplements(Definition container, Class<? extends Definition> objectType) - Returns:
- The implemented interface names of the global references class
for a given definition type, e.g. [com.example.Pojo]. If this
returns
null
or an empty list, then no interfaces are implemented.
-
getJavaClassImplements
This is the same as callinggetJavaClassImplements(definition, Mode.DEFAULT)
- Returns:
- The implemented interface names of the Java class name
representing this object, e.g. [com.example.Pojo] If this returns
null
or an empty list, then no interfaces are implemented.
-
getJavaClassImplements
- Returns:
- The implemented interface names of the Java class name
representing this object, e.g. [com.example.Pojo]. If this
returns
null
or an empty list, then no interfaces are implemented.
-
getGlobalReferencesJavaClassName
String getGlobalReferencesJavaClassName(Definition container, Class<? extends Definition> objectType) - Returns:
- The Java class name of the global references class for a given definition type, e.g. [MyTableSuffix]
-
getJavaClassName
This is the same as callinggetJavaClassName(definition, Mode.DEFAULT)
- Returns:
- The Java class name representing this object, e.g. [MyTable]
-
getJavaClassName
- Returns:
- The Java class name representing this object, e.g. [MyTableSuffix]
-
getGlobalReferencesJavaPackageName
String getGlobalReferencesJavaPackageName(Definition container, Class<? extends Definition> objectType) - Returns:
- The Java package name of the global references class for a given definition type, e.g. [org.jooq.generated]
-
getJavaPackageName
This is the same as callinggetJavaPackageName(definition, Mode.DEFAULT)
- Returns:
- The Java package name of this object, e.g. [org.jooq.generated]
-
getJavaPackageName
- Returns:
- The Java package name of this object, e.g. [org.jooq.generated]
-
getJavaMemberName
The "java member name" is applied where a definition is used as a member (for POJOs) or as a method argument (for setters). Example definitions are This is the same as callinggetJavaMemberName(definition, Mode.DEFAULT)
- Returns:
- The Java class name representing this object, starting with a lower case character, e.g. [myTable]
-
getJavaMemberName
The "java member name" is applied where a definition is used as a member (for POJOs) or as a method argument (for setters). Example definitions are- Returns:
- The Java class name representing this object, starting with a lower case character, e.g. [myTableSuffix]
-
getGlobalReferencesFullJavaClassName
String getGlobalReferencesFullJavaClassName(Definition container, Class<? extends Definition> objectType) - Returns:
- The full Java class name of the global references class for a given definition type, e.g. [org.jooq.generated.MyTable]
-
getFullJavaClassName
- Returns:
- The full Java class name representing this object, e.g. [org.jooq.generated.MyTable]
-
getFullJavaClassName
This is the same as callinggetFullJavaClassName(definition, Mode.DEFAULT)
- Returns:
- The full Java class name representing this object, e.g. [org.jooq.generated.MyTable][suffix]
-
getGlobalReferencesFileName
- Returns:
- The Java class file name of the global references class for a given definition type, e.g. [MyTable.java]
-
getFileName
- Returns:
- The Java class file name representing this object, e.g. [MyTable.java]
-
getFileName
- Returns:
- The Java class file name representing this object, e.g. [MyTableSuffix.java]
-
getFileRoot
File getFileRoot()- Returns:
- The directory containing all Java objects, e.g. [C:\org\jooq\generated]
-
getGlobalReferencesFile
- Returns:
- The Java class file name of the global references class for a given definition type, e.g. [C:\org\jooq\generated\MyTable.java]
-
getFile
- Returns:
- The Java class file name representing this object, e.g. [C:\org\jooq\generated\MyTable.java]
-
getFile
- Returns:
- The Java class file name representing this object, e.g. [C:\org\jooq\generated\MyTableSuffix.java]
-
getFile
- Returns:
- The Java class file name representing this object, e.g. [C:\org\jooq\generated\fileName]
-
getGlobalReferencesFileHeader
- Returns:
- The Java class file header of the global references class for a
given definition type, e.g.
This file is generated by jOOQ.
-
getFileHeader
- Returns:
- The Java class file header, e.g.
This file is generated by jOOQ.
-
getFileHeader
- Returns:
- The Java class file header, e.g.
This file is generated by jOOQ.
-
getOverloadSuffix
- Returns:
- The overload suffix to be applied when generating overloaded
routine artefacts, e.g.
"_OverloadIndex_" + overloadIndex
-