- java.lang.Object
-
- org.jooq.codegen.AbstractGeneratorStrategy
-
- All Implemented Interfaces:
GeneratorStrategy
- Direct Known Subclasses:
DefaultGeneratorStrategy
public abstract class AbstractGeneratorStrategy extends Object implements GeneratorStrategy
Common base class for convenience method abstraction- Author:
- Lukas Eder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jooq.codegen.GeneratorStrategy
GeneratorStrategy.Mode
-
-
Constructor Summary
Constructors Constructor Description AbstractGeneratorStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetFile(String fileName)FilegetFile(Definition definition)FilegetFile(Definition definition, GeneratorStrategy.Mode mode)StringgetFileHeader(Definition definition)StringgetFileName(Definition definition)StringgetFileName(Definition definition, GeneratorStrategy.Mode mode)FilegetFileRoot()StringgetFullJavaClassName(Definition definition)StringgetFullJavaClassName(Definition definition, GeneratorStrategy.Mode mode)This is the same as callinggetFullJavaClassName(definition, Mode.DEFAULT)StringgetFullJavaIdentifier(Definition definition)This is applied to definitions that can result in reference static and instance members.List<String>getFullJavaIdentifiers(Collection<? extends Definition> definitions)List<String>getFullJavaIdentifiers(Definition... definitions)FilegetGlobalReferencesFile(Definition container, Class<? extends Definition> objectType)StringgetGlobalReferencesFileName(Definition container, Class<? extends Definition> objectType)StringgetGlobalReferencesFullJavaClassName(Definition container, Class<? extends Definition> objectType)StringgetJavaClassExtends(Definition definition)This is the same as callinggetJavaClassExtends(definition, Mode.DEFAULT)List<String>getJavaClassImplements(Definition definition)This is the same as callinggetJavaClassImplements(definition, Mode.DEFAULT)StringgetJavaClassName(Definition definition)This is the same as callinggetJavaClassName(definition, Mode.DEFAULT)List<String>getJavaEnumLiterals(EnumDefinition definition, String... literals)List<String>getJavaEnumLiterals(EnumDefinition definition, Collection<? extends String> literals)StringgetJavaGetterName(Definition definition)This is applied to definitions that can result in getters of a container.List<String>getJavaIdentifiers(Collection<? extends Definition> definitions)List<String>getJavaIdentifiers(Definition... definitions)StringgetJavaMemberName(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).StringgetJavaMethodName(Definition definition)This is applied to definitions that can result in methods.StringgetJavaPackageName(Definition definition)This is the same as callinggetJavaPackageName(definition, Mode.DEFAULT)StringgetJavaSetterName(Definition definition)This is applied to definitions that can result in setters of a container.-
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
getFileHeader, getGlobalReferencesFileHeader, getGlobalReferencesJavaClassExtends, getGlobalReferencesJavaClassImplements, getGlobalReferencesJavaClassName, getGlobalReferencesJavaPackageName, getInstanceFields, getJavaBeansGettersAndSetters, getJavaClassExtends, getJavaClassImplements, getJavaClassName, getJavaEnumLiteral, getJavaGetterName, getJavaIdentifier, getJavaMemberName, getJavaMethodName, getJavaPackageName, getJavaSetterName, getOverloadSuffix, getTargetDirectory, getTargetLanguage, getTargetLocale, getTargetPackage, setInstanceFields, setJavaBeansGettersAndSetters, setTargetDirectory, setTargetLanguage, setTargetLocale, setTargetPackage
-
-
-
-
Method Detail
-
getGlobalReferencesFileName
public final String getGlobalReferencesFileName(Definition container, Class<? extends Definition> objectType)
- Specified by:
getGlobalReferencesFileNamein interfaceGeneratorStrategy- Returns:
- The Java class file name of the global references class for a given definition type, e.g. [MyTable.java]
-
getFileName
public final String getFileName(Definition definition)
- Specified by:
getFileNamein interfaceGeneratorStrategy- Returns:
- The Java class file name representing this object, e.g. [MyTable.java]
-
getFileName
public final String getFileName(Definition definition, GeneratorStrategy.Mode mode)
- Specified by:
getFileNamein interfaceGeneratorStrategy- Returns:
- The Java class file name representing this object, e.g. [MyTableSuffix.java]
-
getFileRoot
public final File getFileRoot()
- Specified by:
getFileRootin interfaceGeneratorStrategy- Returns:
- The directory containing all Java objects, e.g. [C:\org\jooq\generated]
-
getGlobalReferencesFile
public final File getGlobalReferencesFile(Definition container, Class<? extends Definition> objectType)
- Specified by:
getGlobalReferencesFilein interfaceGeneratorStrategy- 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
public final File getFile(Definition definition)
- Specified by:
getFilein interfaceGeneratorStrategy- Returns:
- The Java class file name representing this object, e.g. [C:\org\jooq\generated\MyTable.java]
-
getFile
public final File getFile(Definition definition, GeneratorStrategy.Mode mode)
- Specified by:
getFilein interfaceGeneratorStrategy- Returns:
- The Java class file name representing this object, e.g. [C:\org\jooq\generated\MyTableSuffix.java]
-
getFile
public final File getFile(String fileName)
- Specified by:
getFilein interfaceGeneratorStrategy- Returns:
- The Java class file name representing this object, e.g. [C:\org\jooq\generated\fileName]
-
getFileHeader
public final String getFileHeader(Definition definition)
- Specified by:
getFileHeaderin interfaceGeneratorStrategy- Returns:
- The Java class file header, e.g.
This file is generated by jOOQ.
-
getFullJavaIdentifier
public final String getFullJavaIdentifier(Definition definition)
Description copied from interface:GeneratorStrategyThis is applied to definitions that can result in reference static and instance members. For instance, the reference instance of aTableDefinitionis a java identifier- Specified by:
getFullJavaIdentifierin interfaceGeneratorStrategy- Returns:
- The Java identifier representing this object, e.g. [my_table]
-
getJavaSetterName
public final String getJavaSetterName(Definition definition)
Description copied from interface:GeneratorStrategyThis 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 anAttributeDefinitionand the container aUDTDefinitionThis is the same as calling
getJavaSetterName(definition, Mode.DEFAULT)- Specified by:
getJavaSetterNamein interfaceGeneratorStrategy- Returns:
- The Java setter method name representing this object, e.g. [setMyTable]
-
getJavaGetterName
public final String getJavaGetterName(Definition definition)
Description copied from interface:GeneratorStrategyThis 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 anAttributeDefinitionand the container aUDTDefinitionThis is the same as calling
getJavaGetterName(definition, Mode.DEFAULT)- Specified by:
getJavaGetterNamein interfaceGeneratorStrategy- Returns:
- The Java getter method name representing this object, e.g. [getMyTable]
-
getJavaMethodName
public final String getJavaMethodName(Definition definition)
Description copied from interface:GeneratorStrategyThis is applied to definitions that can result in methods. For example, the definition could be aRoutineDefinitionThis is the same as calling
getJavaMethodName(definition, Mode.DEFAULT)- Specified by:
getJavaMethodNamein interfaceGeneratorStrategy- Returns:
- The Java method name representing this object, e.g. [myFunction]
-
getJavaClassExtends
public final String getJavaClassExtends(Definition definition)
Description copied from interface:GeneratorStrategyThis is the same as callinggetJavaClassExtends(definition, Mode.DEFAULT)- Specified by:
getJavaClassExtendsin interfaceGeneratorStrategy- Returns:
- The super class name of the Java class representing this object,
e.g. [com.example.AbstractPojo]. If this returns
nullor an empty string, then no super class is extended.
-
getJavaClassImplements
public final List<String> getJavaClassImplements(Definition definition)
Description copied from interface:GeneratorStrategyThis is the same as callinggetJavaClassImplements(definition, Mode.DEFAULT)- Specified by:
getJavaClassImplementsin interfaceGeneratorStrategy- Returns:
- The implemented interface names of the Java class name
representing this object, e.g. [com.example.Pojo] If this returns
nullor an empty list, then no interfaces are implemented.
-
getJavaClassName
public final String getJavaClassName(Definition definition)
Description copied from interface:GeneratorStrategyThis is the same as callinggetJavaClassName(definition, Mode.DEFAULT)- Specified by:
getJavaClassNamein interfaceGeneratorStrategy- Returns:
- The Java class name representing this object, e.g. [MyTable]
-
getJavaPackageName
public final String getJavaPackageName(Definition definition)
Description copied from interface:GeneratorStrategyThis is the same as callinggetJavaPackageName(definition, Mode.DEFAULT)- Specified by:
getJavaPackageNamein interfaceGeneratorStrategy- Returns:
- The Java package name of this object, e.g. [org.jooq.generated]
-
getJavaMemberName
public final String getJavaMemberName(Definition definition)
Description copied from interface:GeneratorStrategyThe "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)- Specified by:
getJavaMemberNamein interfaceGeneratorStrategy- Returns:
- The Java class name representing this object, starting with a lower case character, e.g. [myTable]
-
getGlobalReferencesFullJavaClassName
public final String getGlobalReferencesFullJavaClassName(Definition container, Class<? extends Definition> objectType)
- Specified by:
getGlobalReferencesFullJavaClassNamein interfaceGeneratorStrategy- Returns:
- The full Java class name of the global references class for a given definition type, e.g. [org.jooq.generated.MyTable]
-
getFullJavaClassName
public final String getFullJavaClassName(Definition definition)
- Specified by:
getFullJavaClassNamein interfaceGeneratorStrategy- Returns:
- The full Java class name representing this object, e.g. [org.jooq.generated.MyTable]
-
getFullJavaClassName
public final String getFullJavaClassName(Definition definition, GeneratorStrategy.Mode mode)
Description copied from interface:GeneratorStrategyThis is the same as callinggetFullJavaClassName(definition, Mode.DEFAULT)- Specified by:
getFullJavaClassNamein interfaceGeneratorStrategy- Returns:
- The full Java class name representing this object, e.g. [org.jooq.generated.MyTable][suffix]
-
getJavaEnumLiterals
public final List<String> getJavaEnumLiterals(EnumDefinition definition, Collection<? extends String> literals)
- Specified by:
getJavaEnumLiteralsin interfaceGeneratorStrategy- See Also:
GeneratorStrategy.getJavaEnumLiteral(EnumDefinition, String)
-
getJavaEnumLiterals
public final List<String> getJavaEnumLiterals(EnumDefinition definition, String... literals)
- Specified by:
getJavaEnumLiteralsin interfaceGeneratorStrategy- See Also:
GeneratorStrategy.getJavaEnumLiteral(EnumDefinition, String)
-
getJavaIdentifiers
public final List<String> getJavaIdentifiers(Collection<? extends Definition> definitions)
- Specified by:
getJavaIdentifiersin interfaceGeneratorStrategy- See Also:
GeneratorStrategy.getJavaIdentifier(Definition)
-
getJavaIdentifiers
public final List<String> getJavaIdentifiers(Definition... definitions)
- Specified by:
getJavaIdentifiersin interfaceGeneratorStrategy- See Also:
GeneratorStrategy.getJavaIdentifier(Definition)
-
getFullJavaIdentifiers
public final List<String> getFullJavaIdentifiers(Collection<? extends Definition> definitions)
- Specified by:
getFullJavaIdentifiersin interfaceGeneratorStrategy- See Also:
GeneratorStrategy.getFullJavaIdentifier(Definition)
-
getFullJavaIdentifiers
public final List<String> getFullJavaIdentifiers(Definition... definitions)
- Specified by:
getFullJavaIdentifiersin interfaceGeneratorStrategy- See Also:
GeneratorStrategy.getFullJavaIdentifier(Definition)
-
-