- All Implemented Interfaces:
GeneratorStrategy
- Direct Known Subclasses:
PrefixSuffixGeneratorStrategy
GeneratorStrategy
that delegates to another one.- Author:
- Lukas Eder
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jooq.codegen.GeneratorStrategy
GeneratorStrategy.Mode
-
Field Summary
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptiongetFileHeader
(Definition definition, GeneratorStrategy.Mode mode) getGlobalReferencesFileHeader
(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, GeneratorStrategy.Mode mode) getJavaClassImplements
(Definition definition, GeneratorStrategy.Mode mode) getJavaEnumLiteral
(EnumDefinition definition, String literal) This is applied to enum literals of a givenEnumDefinition
.getOverloadSuffix
(Definition definition, GeneratorStrategy.Mode mode, String overloadIndex) The target directoryboolean
Whether names of unambiguousForeignKeyDefinition
should be based on the referencedTableDefinition
.void
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 namevoid
setUseTableNameForUnambiguousFKs
(boolean useTableNameForUnambiguousFKs) Whether names of unambiguousForeignKeyDefinition
should be based on the referencedTableDefinition
.Methods inherited from class org.jooq.codegen.AbstractGeneratorStrategy
getFile, getFile, getFile, getFileHeader, getFileName, getFileName, getFileRoot, getFullJavaClassName, getFullJavaClassName, getFullJavaIdentifier, getFullJavaIdentifiers, getFullJavaIdentifiers, getGlobalReferencesFile, getGlobalReferencesFileName, getGlobalReferencesFullJavaClassName, getJavaClassExtends, getJavaClassImplements, getJavaClassName, getJavaEnumLiterals, getJavaEnumLiterals, getJavaGetterName, getJavaIdentifiers, getJavaIdentifiers, getJavaMemberName, getJavaMethodName, getJavaPackageName, getJavaSetterName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jooq.codegen.GeneratorStrategy
getJavaClassName, getJavaGetterName, getJavaIdentifier, getJavaMemberName, getJavaMethodName, getJavaPackageName, getJavaSetterName
-
Field Details
-
delegate
-
-
Constructor Details
-
AbstractDelegatingGeneratorStrategy
public AbstractDelegatingGeneratorStrategy() -
AbstractDelegatingGeneratorStrategy
-
-
Method Details
-
getTargetDirectory
Description copied from interface:GeneratorStrategy
The target directory -
setTargetDirectory
Description copied from interface:GeneratorStrategy
Initialise the target directory -
getTargetPackage
- Returns:
- Get the target package for the current configuration
-
setTargetPackage
Description copied from interface:GeneratorStrategy
Initialise the target package name -
getTargetLocale
- Returns:
- Get the target locale for the current configuration
-
setTargetLocale
Description copied from interface:GeneratorStrategy
Initialise the target locale -
getTargetLanguage
- Returns:
- Get the target language for the current configuration
-
setTargetLanguage
Description copied from interface:GeneratorStrategy
Initialise the target language -
setInstanceFields
public void setInstanceFields(boolean instanceFields) Description copied from interface:GeneratorStrategy
Whether fields are instance fields (as opposed to static fields) -
getInstanceFields
public boolean getInstanceFields()Description copied from interface:GeneratorStrategy
Whether fields are instance fields (as opposed to static fields) -
setJavaBeansGettersAndSetters
public void setJavaBeansGettersAndSetters(boolean javaBeansGettersAndSetters) Description copied from interface:GeneratorStrategy
Whether getters and setters should be generated JavaBeans style (or jOOQ style). -
getJavaBeansGettersAndSetters
public boolean getJavaBeansGettersAndSetters()Description copied from interface:GeneratorStrategy
Whether getters and setters should be generated JavaBeans style (or jOOQ style). -
setUseTableNameForUnambiguousFKs
public void setUseTableNameForUnambiguousFKs(boolean useTableNameForUnambiguousFKs) Description copied from interface:GeneratorStrategy
Whether names of unambiguousForeignKeyDefinition
should be based on the referencedTableDefinition
.When a child table has only one
ForeignKeyDefinition
towards a parent table, then that path is "unambiguous." In that case, someGeneratorStrategy
implementations may choose to use the parent table'sTableDefinition
for implementations ofGeneratorStrategy.getJavaMethodName(Definition)
, instead of theForeignKeyDefinition
, e.g. for implicit join paths.This flag allows for turning off this default behaviour.
-
getUseTableNameForUnambiguousFKs
public boolean getUseTableNameForUnambiguousFKs()Description copied from interface:GeneratorStrategy
Whether names of unambiguousForeignKeyDefinition
should be based on the referencedTableDefinition
.When a child table has only one
ForeignKeyDefinition
towards a parent table, then that path is "unambiguous." In that case, someGeneratorStrategy
implementations may choose to use the parent table'sTableDefinition
for implementations ofGeneratorStrategy.getJavaMethodName(Definition)
, instead of theForeignKeyDefinition
, e.g. for implicit join paths.This flag allows for turning off this default behaviour.
-
getJavaEnumLiteral
Description copied from interface:GeneratorStrategy
This is applied to enum literals of a givenEnumDefinition
.- Returns:
- The Java identifier representing this enum literal, e.g. [OK]
-
getGlobalReferencesJavaClassExtends
public 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
- 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
public 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
- 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
public 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]
-
getGlobalReferencesJavaPackageName
public 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]
-
getGlobalReferencesFileHeader
public String getGlobalReferencesFileHeader(Definition container, Class<? extends Definition> objectType) - 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.
-
getOverloadSuffix
public String getOverloadSuffix(Definition definition, GeneratorStrategy.Mode mode, String overloadIndex) - Returns:
- The overload suffix to be applied when generating overloaded
routine artefacts, e.g.
"_OverloadIndex_" + overloadIndex
-