Klasse DefaultGeneratorStrategy

java.lang.Object
org.jooq.codegen.AbstractGeneratorStrategy
org.jooq.codegen.DefaultGeneratorStrategy
Alle implementierten Schnittstellen:
GeneratorStrategy
Bekannte direkte Unterklassen:
JPrefixGeneratorStrategy, JVMArgsGeneratorStrategy, KeepNamesGeneratorStrategy, MatcherStrategy

public class DefaultGeneratorStrategy extends AbstractGeneratorStrategy
The default naming strategy for the JavaGenerator
Autor:
Lukas Eder
  • Konstruktordetails

    • DefaultGeneratorStrategy

      public DefaultGeneratorStrategy()
  • Methodendetails

    • setInstanceFields

      public void setInstanceFields(boolean instanceFields)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Whether fields are instance fields (as opposed to static fields)
    • getInstanceFields

      public boolean getInstanceFields()
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Whether fields are instance fields (as opposed to static fields)
    • setJavaBeansGettersAndSetters

      public void setJavaBeansGettersAndSetters(boolean javaBeansGettersAndSetters)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Whether getters and setters should be generated JavaBeans style (or jOOQ style).
    • getJavaBeansGettersAndSetters

      public boolean getJavaBeansGettersAndSetters()
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Whether getters and setters should be generated JavaBeans style (or jOOQ style).
    • setUseTableNameForUnambiguousFKs

      public void setUseTableNameForUnambiguousFKs(boolean useTableNameForUnambiguousFKs)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      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 GeneratorStrategy.getJavaMethodName(Definition), instead of the ForeignKeyDefinition, e.g. for implicit join paths.

      This flag allows for turning off this default behaviour.

    • getUseTableNameForUnambiguousFKs

      public boolean getUseTableNameForUnambiguousFKs()
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      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 GeneratorStrategy.getJavaMethodName(Definition), instead of the ForeignKeyDefinition, e.g. for implicit join paths.

      This flag allows for turning off this default behaviour.

    • getTargetDirectory

      public String getTargetDirectory()
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      The target directory
    • setTargetDirectory

      public void setTargetDirectory(String directory)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Initialise the target directory
    • getTargetPackage

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

      public void setTargetPackage(String packageName)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Initialise the target package name
    • getTargetLocale

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

      public void setTargetLocale(Locale targetLocale)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Initialise the target locale
    • getTargetLanguage

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

      public void setTargetLanguage(Language targetLanguage)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      Initialise the target language
    • getGlobalReferencesFileHeader

      public 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

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

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

      public String getJavaIdentifier(Definition definition)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      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]
    • getJavaSetterName

      public String getJavaSetterName(Definition definition, GeneratorStrategy.Mode mode)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      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]
    • getJavaGetterName

      public String getJavaGetterName(Definition definition, GeneratorStrategy.Mode mode)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      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]
    • getJavaMethodName

      public String getJavaMethodName(Definition definition, GeneratorStrategy.Mode mode)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      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]
    • getGlobalReferencesJavaClassExtends

      public 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

      public 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.
    • getGlobalReferencesJavaClassImplements

      public 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

      public 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.
    • getGlobalReferencesJavaClassName

      public 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

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

      public 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

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

      public String getJavaMemberName(Definition definition, GeneratorStrategy.Mode mode)
      Beschreibung aus Schnittstelle kopiert: GeneratorStrategy
      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]
    • getOverloadSuffix

      public 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