Interface ReverseCustomizer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Invoked when the customizer is no longer needed.
      void customize​(ClassMapping cls)
      Customize the given class information produced by the reverse mapping tool.
      void customize​(FieldMapping field)
      Customize the given field information produced by the reverse mapping tool.
      java.lang.String getClassCode​(ClassMapping mapping)
      Return a code template for the given class, or null to use the standard system-generated Java code.
      java.lang.String getClassName​(Table table, java.lang.String defaultName)
      Return the fully-qualified class name to generate for the given table.
      java.lang.String getDeclaration​(FieldMapping field)
      Return a code template for the declaration of the given field, or null to use the system-generated default Java code.
      java.lang.String getFieldCode​(FieldMapping field)
      Return a code template for the get/set methods of the given field, or null to use the system-generated default Java code.
      java.lang.String getFieldName​(ClassMapping dec, Column[] cols, ForeignKey fk, java.lang.String defaultName)
      Return the field name used to map the given columns, or null to prevent the columns from being mapped.
      java.lang.String getInitialValue​(FieldMapping field)
      Return code for the initial value for the given field, or null to use the default generated by the system.
      int getTableType​(Table table, int defaultType)
      Return the type of the given table, or the given default type.
      void setConfiguration​(java.util.Properties props)
      Set configuration properties given by the user.
      void setTool​(ReverseMappingTool tool)
      Set the reverse mapping tool using this customizer.
      boolean unmappedTable​(Table table)
      Notification that a table has gone unmapped.
    • Method Detail

      • setConfiguration

        void setConfiguration​(java.util.Properties props)
        Set configuration properties given by the user.
      • setTool

        void setTool​(ReverseMappingTool tool)
        Set the reverse mapping tool using this customizer. You can use the tool to see how it is configured, or to use utility methods the tool provides.
      • getTableType

        int getTableType​(Table table,
                         int defaultType)
        Return the type of the given table, or the given default type. See the TABLE_XXX constants in ReverseMappingTool.
      • getClassName

        java.lang.String getClassName​(Table table,
                                      java.lang.String defaultName)
        Return the fully-qualified class name to generate for the given table. Return null to prevent the table from being mapped. Return the given default name if it is acceptable.
      • getClassCode

        java.lang.String getClassCode​(ClassMapping mapping)
        Return a code template for the given class, or null to use the standard system-generated Java code. To facilitate template reuse, the following parameters can appear in your template; the proper values will be subtituted by the system:
        • ${packageDec}: The package declaration, in the form "package <package name >;", or empty string if no package.
        • ${imports}: Imports for the packages used by the declared field types.
        • ${className}: The name of the class, without package.
        • ${extendsDec}: Extends declaration, in the form "extends <superclass>", or empty string if no superclass.
        • ${constructor}: A constructor that takes in all primary key fields of the class, or empty string if the class uses datastore identity.
        • ${fieldDecs}: Declarations of all the generated fields.
        • ${fieldCode}: Get/set methods for all the generated fields.
      • getFieldName

        java.lang.String getFieldName​(ClassMapping dec,
                                      Column[] cols,
                                      ForeignKey fk,
                                      java.lang.String defaultName)
        Return the field name used to map the given columns, or null to prevent the columns from being mapped. Return the given default if it is acceptable.
        Parameters:
        dec - the class that will declare this field
        cols - the column(s) this field will represent
        fk - for relation fields, the foreign key to the related type
      • customize

        void customize​(FieldMapping field)
        Customize the given field information produced by the reverse mapping tool.
      • getInitialValue

        java.lang.String getInitialValue​(FieldMapping field)
        Return code for the initial value for the given field, or null to use the default generated by the system.
      • getDeclaration

        java.lang.String getDeclaration​(FieldMapping field)
        Return a code template for the declaration of the given field, or null to use the system-generated default Java code. To facilitate template reuse, the following parameters can appear in your template; the proper values will be subtituted by the system:
        • ${fieldName}: The name of the field.
        • ${capFieldName}: The capitalized field name.
        • ${propertyName}: The field name without leading '_', if any.
        • ${fieldType}: The field's type name.
        • ${fieldValue}: The field's initial value, in the form " = <value>", or empty string if none.
      • getFieldCode

        java.lang.String getFieldCode​(FieldMapping field)
        Return a code template for the get/set methods of the given field, or null to use the system-generated default Java code. To facilitate template reuse, the following parameters can appear in your template; the proper values will be subtituted by the system:
        • ${fieldName}: The name of the field.
        • ${capFieldName}: The capitalized field name.
        • ${propertyName}: The field name without leading '_', if any.
        • ${fieldType}: The field's type name.
        • ${fieldValue}: The field's initial value, in the form "= <value>", or empty string if none.
      • close

        void close()
        Invoked when the customizer is no longer needed.
        Specified by:
        close in interface Closeable