org.jooq.util
Class DefaultGeneratorStrategy

java.lang.Object
  extended by org.jooq.util.AbstractGeneratorStrategy
      extended by org.jooq.util.DefaultGeneratorStrategy
All Implemented Interfaces:
GeneratorStrategy

public class DefaultGeneratorStrategy
extends AbstractGeneratorStrategy

The default naming strategy for the DefaultGenerator

Author:
Lukas Eder

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jooq.util.GeneratorStrategy
GeneratorStrategy.Mode
 
Constructor Summary
DefaultGeneratorStrategy()
           
 
Method Summary
 boolean getInstanceFields()
          Whether fields are instance fields (as opposed to static fields)
 String getJavaClassName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
           
 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, 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, GeneratorStrategy.Mode mode)
          This is applied to definitions that can result in methods.
 String getJavaPackageName(org.jooq.util.Definition definition, GeneratorStrategy.Mode mode)
           
 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
 
Methods inherited from class org.jooq.util.AbstractGeneratorStrategy
getFile, getFile, getFileName, getFileName, getFullJavaClassName, getFullJavaClassName, getFullJavaIdentifier, getJavaClassName, getJavaGetterName, getJavaMemberName, getJavaMethodName, getJavaPackageName, getJavaSetterName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGeneratorStrategy

public DefaultGeneratorStrategy()
Method Detail

setInstanceFields

public final void setInstanceFields(boolean instanceFields)
Description copied from interface: GeneratorStrategy
Whether fields are instance fields (as opposed to static fields)


getInstanceFields

public final boolean getInstanceFields()
Description copied from interface: GeneratorStrategy
Whether fields are instance fields (as opposed to static fields)


getTargetDirectory

public final String getTargetDirectory()
Description copied from interface: GeneratorStrategy
The target directory


setTargetDirectory

public final void setTargetDirectory(String directory)
Description copied from interface: GeneratorStrategy
Initialise the target directory


getTargetPackage

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

setTargetPackage

public final void setTargetPackage(String packageName)
Description copied from interface: GeneratorStrategy
Initialise the target package name


getJavaIdentifier

public String getJavaIdentifier(org.jooq.util.Definition definition)
Description copied from interface: GeneratorStrategy
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

public String getJavaSetterName(org.jooq.util.Definition definition,
                                GeneratorStrategy.Mode mode)
Description copied from interface: 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

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

getJavaGetterName

public String getJavaGetterName(org.jooq.util.Definition definition,
                                GeneratorStrategy.Mode mode)
Description copied from interface: 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

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

getJavaMethodName

public String getJavaMethodName(org.jooq.util.Definition definition,
                                GeneratorStrategy.Mode mode)
Description copied from interface: GeneratorStrategy
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

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

getJavaPackageName

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

getJavaMemberName

public String getJavaMemberName(org.jooq.util.Definition definition,
                                GeneratorStrategy.Mode mode)
Description copied from interface: 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

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


Copyright © 2012. All Rights Reserved.