org.jooq.util
Interface GeneratorStrategy

All Known Implementing Classes:
AbstractGeneratorStrategy, DefaultGeneratorStrategy

public interface GeneratorStrategy

A strategy for naming various artefacts generated from Definition's

Author:
Lukas Eder

Nested Class Summary
static class GeneratorStrategy.Mode
          The "mode" by which an artefact should be named
 
Method Summary
 File getFile(org.jooq.util.Definition definition)
           
 File getFile(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
           
 String getFileName(org.jooq.util.Definition definition)
           
 String getFileName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
           
 String getFullJavaClassName(org.jooq.util.Definition definition)
           
 String getFullJavaClassName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
          This is the same as calling getFullJavaClassName(definition, Mode.DEFAULT)
 String getFullJavaIdentifier(org.jooq.util.Definition definition)
          This is applied to definitions that can result in singleton static and instance members.
 boolean getInstanceFields()
          Whether fields are instance fields (as opposed to static fields)
 String getJavaClassName(org.jooq.util.Definition definition)
          This is the same as calling getJavaClassName(definition, Mode.DEFAULT)
 String getJavaClassName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
           
 String getJavaGetterName(org.jooq.util.Definition definition)
          This is applied to definitions that can result in getters of a container.
 String getJavaGetterName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
          This is applied to definitions that can result in getters of a container.
 String getJavaIdentifier(org.jooq.util.Definition definition)
          This is applied to definitions that can result in singleton static and instance members.
 String getJavaMemberName(org.jooq.util.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).
 String getJavaMemberName(org.jooq.util.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).
 String getJavaMethodName(org.jooq.util.Definition definition)
          This is applied to definitions that can result in methods.
 String getJavaMethodName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
          This is applied to definitions that can result in methods.
 String getJavaPackageName(org.jooq.util.Definition definition)
          This is the same as calling getJavaPackageName(definition, Mode.DEFAULT)
 String getJavaPackageName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
           
 String getJavaSetterName(org.jooq.util.Definition definition)
          This is applied to definitions that can result in setters of a container.
 String getJavaSetterName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
          This is applied to definitions that can result in setters of a container.
 String getTargetDirectory()
          The target directory
 String getTargetPackage()
           
 void setInstanceFields(boolean instanceFields)
          Whether fields are instance fields (as opposed to static fields)
 void setTargetDirectory(String directory)
          Initialise the target directory
 void setTargetPackage(String packageName)
          Initialise the target package name
 

Method Detail

getTargetDirectory

String getTargetDirectory()
The target directory


setTargetDirectory

void setTargetDirectory(String directory)
Initialise the target directory


getTargetPackage

String getTargetPackage()
Returns:
Get the target package for the current configuration

setTargetPackage

void setTargetPackage(String packageName)
Initialise the target package name


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)


getJavaIdentifier

String getJavaIdentifier(org.jooq.util.Definition definition)
This is applied to definitions that can result in singleton static and instance members. For instance, the singleton instance of a TableDefinition is a java identifier

Returns:
The Java identifier representing this object, e.g. [my_table]

getFullJavaIdentifier

String getFullJavaIdentifier(org.jooq.util.Definition definition)
This is applied to definitions that can result in singleton static and instance members. For instance, the singleton instance of a TableDefinition is a java identifier

Returns:
The Java identifier representing this object, e.g. [my_table]

getJavaSetterName

String getJavaSetterName(org.jooq.util.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)

Returns:
The Java setter method name representing this object, e.g. [setMyTable]

getJavaSetterName

String getJavaSetterName(org.jooq.util.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

Returns:
The Java setter method name representing this object, e.g. [setMyTable]

getJavaGetterName

String getJavaGetterName(org.jooq.util.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)

Returns:
The Java getter method name representing this object, e.g. [getMyTable]

getJavaGetterName

String getJavaGetterName(org.jooq.util.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

Returns:
The Java getter method name representing this object, e.g. [getMyTable]

getJavaMethodName

String getJavaMethodName(org.jooq.util.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)

Returns:
The Java method name representing this object, e.g. [myFunction]

getJavaMethodName

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

Returns:
The Java method name representing this object, e.g. [myFunction]

getJavaClassName

String getJavaClassName(org.jooq.util.Definition definition)
This is the same as calling getJavaClassName(definition, Mode.DEFAULT)

Returns:
The Java class name representing this object, e.g. [MyTable]

getJavaClassName

String getJavaClassName(org.jooq.util.Definition definition,
                        GeneratorStrategy.Mode mode)
Returns:
The Java class name representing this object, e.g. [MyTableSuffix]

getJavaPackageName

String getJavaPackageName(org.jooq.util.Definition definition)
This is the same as calling getJavaPackageName(definition, Mode.DEFAULT)

Returns:
The Java package name of this object, e.g. [org.jooq.generated]

getJavaPackageName

String getJavaPackageName(org.jooq.util.Definition definition,
                          GeneratorStrategy.Mode mode)
Returns:
The Java package name of this object, e.g. [org.jooq.generated]

getJavaMemberName

String getJavaMemberName(org.jooq.util.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)

Returns:
The Java class name representing this object, starting with a lower case character, e.g. [myTable]

getJavaMemberName

String getJavaMemberName(org.jooq.util.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

Returns:
The Java class name representing this object, starting with a lower case character, e.g. [myTableSuffix]

getFullJavaClassName

String getFullJavaClassName(org.jooq.util.Definition definition)
Returns:
The full Java class name representing this object, e.g. [org.jooq.generated.MyTable]

getFullJavaClassName

String getFullJavaClassName(org.jooq.util.Definition definition,
                            GeneratorStrategy.Mode mode)
This is the same as calling getFullJavaClassName(definition, Mode.DEFAULT)

Returns:
The full Java class name representing this object, e.g. [org.jooq.generated.MyTable][suffix]

getFileName

String getFileName(org.jooq.util.Definition definition)
Returns:
The Java class file name representing this object, e.g. [MyTable.java]

getFileName

String getFileName(org.jooq.util.Definition definition,
                   GeneratorStrategy.Mode mode)
Returns:
The Java class file name representing this object, e.g. [MyTableSuffix.java]

getFile

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

getFile

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


Copyright © 2012. All Rights Reserved.