Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.3.5 generated on August 31 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.jdbc.meta
Interface ReverseCustomizer

All Known Implementing Classes:
  PropertiesReverseCustomizer

public interface ReverseCustomizer

Plugin in interface to customize the output of the `ReverseMappingTool`.

Method Summary
`boolean` | `customize(ClassMapping mapping)` Customize the given class information produced by the reverse mapping tool.
`boolean` | `customize(FieldMapping mapping)` Customize the given field information produced by the reverse mapping tool.
`String` | `getClassCode(ClassMapping mapping)` Return a code template for the given class, or null to use the standard system-generated Java code.
`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.
`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.
`String` | `getInitialValue(FieldMapping field)` Return code for the initial value for the given field, or null to use the default generated by the system.
`boolean` | `isSubclassTable(Table table)` Return true if the given table is for a class that is a subclass of another persistent type.
`void` | `setConfiguration(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

    public void setConfiguration(Properties props)

  Set configuration properties given by the user.

### setTool

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

### isSubclassTable

    public boolean isSubclassTable(Table table)

  Return true if the given table is for a class that is a subclass of another persistent type. By default, the reverse mapping tool produces only base classes.

### customize

    public boolean customize(ClassMapping mapping)

  Customize the given class information produced by the reverse mapping tool. You can change the settings of the given mapping, including the name of the generated class (using `ReverseMappingTool.generateClass(java.lang.String, java.lang.Class)` to creat a new class object, then setting it with `ClassMetaData.setDescribedType(java.lang.Class)`). The mapping will not have any fields yet when this method is called.
  Returns:
    false to reject this mapping

### getClassCode

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

### customize

    public boolean customize(FieldMapping mapping)

  Customize the given field information produced by the reverse mapping tool. You can change the settings of the given mapping. The mapping will not be finalized when this method is called, and may not be able to respond to certain methods that require access to relation/inverse fields.
  Returns:
    false to reject this mapping

### getInitialValue

    public 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

    public 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

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

### unmappedTable

    public boolean unmappedTable(Table table)

  Notification that a table has gone unmapped. You can map the table yourself using this method. When mapping, use `ReverseMappingTool.newClassMetaData(java.lang.Class, java.lang.Class, int)` to create class metadata, and `ReverseMappingTool.newFieldMetaData(java.lang.String, java.lang.Class, kodo.meta.ClassMetaData)` to create field metadata. Once the metadata is created, you can wrap it in `ClassMapping` and `FieldMapping` instances. Then, add the mappings (class first) to the tool via `ReverseMappingTool.addClassMapping(kodo.jdbc.meta.ClassMapping)` and `ReverseMappingTool.addFieldMapping(kodo.jdbc.meta.FieldMapping, kodo.jdbc.meta.ClassMapping)`. These add methods will call your `customize(kodo.jdbc.meta.ClassMapping)` methods in turn.
  Returns:
    true if you map the table, false otherwise

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.3.5 generated on August 31 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.