Schnittstelle GeneratorStrategy

Alle bekannten Implementierungsklassen:
AbstractDelegatingGeneratorStrategy, AbstractGeneratorStrategy, DefaultGeneratorStrategy, JPrefixGeneratorStrategy, JVMArgsGeneratorStrategy, KeepNamesGeneratorStrategy, MatcherStrategy, PascalCaseGeneratorStrategy, PrefixSuffixGeneratorStrategy

public interface GeneratorStrategy
A strategy for naming various artefacts generated from Definition's
Autor:
Lukas Eder
  • Methodendetails

    • getTargetDirectory

      String getTargetDirectory()
      The target directory
    • setTargetDirectory

      void setTargetDirectory(String directory)
      Initialise the target directory
    • getTargetPackage

      String getTargetPackage()
      Gibt zurück:
      Get the target package for the current configuration
    • setTargetPackage

      void setTargetPackage(String packageName)
      Initialise the target package name
    • getTargetLocale

      Locale getTargetLocale()
      Gibt zurück:
      Get the target locale for the current configuration
    • setTargetLocale

      void setTargetLocale(Locale targetLocale)
      Initialise the target locale
    • getTargetLanguage

      Language getTargetLanguage()
      Gibt zurück:
      Get the target language for the current configuration
    • setTargetLanguage

      void setTargetLanguage(Language targetLanguage)
      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).
    • setUseTableNameForUnambiguousFKs

      void setUseTableNameForUnambiguousFKs(boolean useTableNameForUnambiguousFKs)
      Whether names of unambiguous ForeignKeyDefinition should be based on the referenced TableDefinition.

      When a child table has only one ForeignKeyDefinition towards a parent table, then that path is "unambiguous." In that case, some GeneratorStrategy implementations may choose to use the parent table's TableDefinition for implementations of getJavaMethodName(Definition), instead of the ForeignKeyDefinition, e.g. for implicit join paths.

      This flag allows for turning off this default behaviour.

    • getUseTableNameForUnambiguousFKs

      boolean getUseTableNameForUnambiguousFKs()
      Whether names of unambiguous ForeignKeyDefinition should be based on the referenced TableDefinition.

      When a child table has only one ForeignKeyDefinition towards a parent table, then that path is "unambiguous." In that case, some GeneratorStrategy implementations may choose to use the parent table's TableDefinition for implementations of getJavaMethodName(Definition), instead of the ForeignKeyDefinition, e.g. for implicit join paths.

      This flag allows for turning off this default behaviour.

    • getJavaEnumLiteral

      String getJavaEnumLiteral(EnumDefinition definition, String literal)
      This is applied to enum literals of a given EnumDefinition.
      Gibt zurück:
      The Java identifier representing this enum literal, e.g. [OK]
    • getJavaEnumLiterals

      List<String> getJavaEnumLiterals(EnumDefinition definition, Collection<? extends String> literals)
      Siehe auch:
    • getJavaEnumLiterals

      List<String> getJavaEnumLiterals(EnumDefinition definition, String... literals)
      Siehe auch:
    • getJavaIdentifier

      String getJavaIdentifier(Definition definition)
      This is applied to definitions that can result in reference static and instance members. For instance, the reference instance of a TableDefinition is a java identifier
      Gibt zurück:
      The Java identifier representing this object, e.g. [my_table]
    • getJavaIdentifiers

      List<String> getJavaIdentifiers(Collection<? extends Definition> definitions)
      Siehe auch:
    • getJavaIdentifiers

      List<String> getJavaIdentifiers(Definition... definitions)
      Siehe auch:
    • getFullJavaIdentifier

      String getFullJavaIdentifier(Definition definition)
      This is applied to definitions that can result in reference static and instance members. For instance, the reference instance of a TableDefinition is a java identifier
      Gibt zurück:
      The Java identifier representing this object, e.g. [my_table]
    • getFullJavaIdentifiers

      List<String> getFullJavaIdentifiers(Collection<? extends Definition> definitions)
      Siehe auch:
    • getFullJavaIdentifiers

      List<String> getFullJavaIdentifiers(Definition... definitions)
      Siehe auch:
    • getJavaSetterName

      String getJavaSetterName(Definition definition)
      This is applied to definitions that can result in setters of a container. For example, the definition could be a ColumnDefinition, the container a TableDefinition. Then this would apply to records and POJOs. Also, the definition could be an AttributeDefinition and the container a UDTDefinition

      This is the same as calling getJavaSetterName(definition, Mode.DEFAULT)

      Gibt zurück:
      The Java setter method name representing this object, e.g. [setMyTable]
    • getJavaSetterName

      String getJavaSetterName(Definition definition, GeneratorStrategy.Mode mode)
      This is applied to definitions that can result in setters of a container. For example, the definition could be a ColumnDefinition, the container a TableDefinition. Then this would apply to records and POJOs. Also, the definition could be an AttributeDefinition and the container a UDTDefinition
      Gibt zurück:
      The Java setter method name representing this object, e.g. [setMyTable]
    • getJavaSetterOverride

      boolean getJavaSetterOverride(Definition definition, GeneratorStrategy.Mode mode)
      Whether the getJavaSetterName(Definition, Mode) produces a method that overrides a member from a parent type unknown to jOOQ, e.g. from getJavaClassExtends(Definition, Mode) or getJavaClassImplements(Definition, Mode).
    • getJavaGetterName

      String getJavaGetterName(Definition definition)
      This is applied to definitions that can result in getters of a container. For example, the definition could be a ColumnDefinition, the container a TableDefinition. Then this would apply to records and POJOs. Also, the definition could be an AttributeDefinition and the container a UDTDefinition

      This is the same as calling getJavaGetterName(definition, Mode.DEFAULT)

      Gibt zurück:
      The Java getter method name representing this object, e.g. [getMyTable]
    • getJavaGetterName

      String getJavaGetterName(Definition definition, GeneratorStrategy.Mode mode)
      This is applied to definitions that can result in getters of a container. For example, the definition could be a ColumnDefinition, the container a TableDefinition. Then this would apply to records and POJOs. Also, the definition could be an AttributeDefinition and the container a UDTDefinition
      Gibt zurück:
      The Java getter method name representing this object, e.g. [getMyTable]
    • getJavaGetterOverride

      boolean getJavaGetterOverride(Definition definition, GeneratorStrategy.Mode mode)
      Whether the getJavaGetterName(Definition, Mode) produces a method that overrides a member from a parent type unknown to jOOQ, e.g. from getJavaClassExtends(Definition, Mode) or getJavaClassImplements(Definition, Mode).
    • getJavaMethodName

      String getJavaMethodName(Definition definition)
      This is applied to definitions that can result in methods. For example, the definition could be a RoutineDefinition

      This is the same as calling getJavaMethodName(definition, Mode.DEFAULT)

      Gibt zurück:
      The Java method name representing this object, e.g. [myFunction]
    • getJavaMethodName

      String getJavaMethodName(Definition definition, GeneratorStrategy.Mode mode)
      This is applied to definitions that can result in methods. For example, the definition could be a RoutineDefinition
      Gibt zurück:
      The Java method name representing this object, e.g. [myFunction]
    • getJavaMethodOverride

      boolean getJavaMethodOverride(Definition definition, GeneratorStrategy.Mode mode)
      Whether the getJavaMethodName(Definition, Mode) produces a method that overrides a member from a parent type unknown to jOOQ, e.g. from getJavaClassExtends(Definition, Mode) or getJavaClassImplements(Definition, Mode).
    • getGlobalNamesJavaClassExtends

      String getGlobalNamesJavaClassExtends(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The super class name of the global names 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.
    • getGlobalReferencesJavaClassExtends

      String getGlobalReferencesJavaClassExtends(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      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

      String getJavaClassExtends(Definition definition)
      This is the same as calling getJavaClassExtends(definition, Mode.DEFAULT)
      Gibt zurück:
      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

      String getJavaClassExtends(Definition definition, GeneratorStrategy.Mode mode)
      Gibt zurück:
      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.
    • getGlobalNamesJavaClassImplements

      List<String> getGlobalNamesJavaClassImplements(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The implemented interface names of the global names class for a given definition type, e.g. [com.example.Pojo]. If this returns null or an empty list, then no interfaces are implemented.
    • getGlobalReferencesJavaClassImplements

      List<String> getGlobalReferencesJavaClassImplements(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      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

      List<String> getJavaClassImplements(Definition definition)
      This is the same as calling getJavaClassImplements(definition, Mode.DEFAULT)
      Gibt zurück:
      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

      List<String> getJavaClassImplements(Definition definition, GeneratorStrategy.Mode mode)
      Gibt zurück:
      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.
    • getGlobalNamesJavaClassName

      String getGlobalNamesJavaClassName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class name of the global names class for a given definition type, e.g. [TableNames]
    • getGlobalReferencesJavaClassName

      String getGlobalReferencesJavaClassName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class name of the global references class for a given definition type, e.g. [MyTableSuffix]
    • getJavaClassName

      String getJavaClassName(Definition definition)
      This is the same as calling getJavaClassName(definition, Mode.DEFAULT)
      Gibt zurück:
      The Java class name representing this object, e.g. [MyTable]
    • getJavaClassName

      String getJavaClassName(Definition definition, GeneratorStrategy.Mode mode)
      Gibt zurück:
      The Java class name representing this object, e.g. [MyTableSuffix]
    • getGlobalNamesJavaPackageName

      String getGlobalNamesJavaPackageName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java package name of the global names class for a given definition type, e.g. [org.jooq.generated]
    • getGlobalReferencesJavaPackageName

      String getGlobalReferencesJavaPackageName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java package name of the global references class for a given definition type, e.g. [org.jooq.generated]
    • getJavaPackageName

      String getJavaPackageName(Definition definition)
      This is the same as calling getJavaPackageName(definition, Mode.DEFAULT)
      Gibt zurück:
      The Java package name of this object, e.g. [org.jooq.generated]
    • getJavaPackageName

      String getJavaPackageName(Definition definition, GeneratorStrategy.Mode mode)
      Gibt zurück:
      The Java package name of this object, e.g. [org.jooq.generated]
    • getJavaMemberName

      String 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). Example definitions are This is the same as calling getJavaMemberName(definition, Mode.DEFAULT)
      Gibt zurück:
      The Java class name representing this object, starting with a lower case character, e.g. [myTable]
    • getJavaMemberName

      String 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). Example definitions are
      Gibt zurück:
      The Java class name representing this object, starting with a lower case character, e.g. [myTableSuffix]
    • getJavaMemberOverride

      boolean getJavaMemberOverride(Definition definition, GeneratorStrategy.Mode mode)
      Whether the getJavaMemberName(Definition, Mode) produces a member that overrides a member from a parent type unknown to jOOQ, e.g. from getJavaClassExtends(Definition, Mode) or getJavaClassImplements(Definition, Mode).
    • getGlobalNamesFullJavaClassName

      String getGlobalNamesFullJavaClassName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The full Java class name of the global names class for a given definition type, e.g. [org.jooq.generated.TableNames]
    • getGlobalReferencesFullJavaClassName

      String getGlobalReferencesFullJavaClassName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The full Java class name of the global references class for a given definition type, e.g. [org.jooq.generated.MyTable]
    • getFullJavaClassName

      String getFullJavaClassName(Definition definition)
      Gibt zurück:
      The full Java class name representing this object, e.g. [org.jooq.generated.MyTable]
    • getFullJavaClassName

      String getFullJavaClassName(Definition definition, GeneratorStrategy.Mode mode)
      This is the same as calling getFullJavaClassName(definition, Mode.DEFAULT)
      Gibt zurück:
      The full Java class name representing this object, e.g. [org.jooq.generated.MyTable][suffix]
    • getGlobalNamesFileName

      String getGlobalNamesFileName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class file name of the global names class for a given definition type, e.g. [TableNames.java]
    • getGlobalReferencesFileName

      String getGlobalReferencesFileName(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class file name of the global references class for a given definition type, e.g. [MyTable.java]
    • getFileName

      String getFileName(Definition definition)
      Gibt zurück:
      The Java class file name representing this object, e.g. [MyTable.java]
    • getFileName

      String getFileName(Definition definition, GeneratorStrategy.Mode mode)
      Gibt zurück:
      The Java class file name representing this object, e.g. [MyTableSuffix.java]
    • getFileRoot

      File getFileRoot()
      Gibt zurück:
      The directory containing all Java objects, e.g. [C:\org\jooq\generated]
    • getGlobalNamesFile

      File getGlobalNamesFile(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class file name of the global names class for a given definition type, e.g. [C:\org\jooq\generated\TableNames.java]
    • getGlobalReferencesFile

      File getGlobalReferencesFile(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class file name of the global references class for a given definition type, e.g. [C:\org\jooq\generated\MyTable.java]
    • getFile

      File getFile(Definition definition)
      Gibt zurück:
      The Java class file name representing this object, e.g. [C:\org\jooq\generated\MyTable.java]
    • getFile

      File getFile(Definition definition, GeneratorStrategy.Mode mode)
      Gibt zurück:
      The Java class file name representing this object, e.g. [C:\org\jooq\generated\MyTableSuffix.java]
    • getFile

      File getFile(String fileName)
      Gibt zurück:
      The Java class file name representing this object, e.g. [C:\org\jooq\generated\fileName]
    • getGlobalNamesFileHeader

      String getGlobalNamesFileHeader(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class file header of the global names class for a given definition type, e.g.
      
       This file is generated by jOOQ.
       
    • getGlobalReferencesFileHeader

      String getGlobalReferencesFileHeader(Definition container, Class<? extends Definition> objectType)
      Gibt zurück:
      The Java class file header of the global references class for a given definition type, e.g.
      
       This file is generated by jOOQ.
       
    • getFileHeader

      String getFileHeader(Definition definition)
      Gibt zurück:
      The Java class file header, e.g.
      
       This file is generated by jOOQ.
       
    • getFileHeader

      String getFileHeader(Definition definition, GeneratorStrategy.Mode mode)
      Gibt zurück:
      The Java class file header, e.g.
      
       This file is generated by jOOQ.
       
    • getOverloadSuffix

      String getOverloadSuffix(Definition definition, GeneratorStrategy.Mode mode, String overloadIndex)
      Gibt zurück:
      The overload suffix to be applied when generating overloaded routine artefacts, e.g. "_OverloadIndex_" + overloadIndex