Copier API

The Copier abstract class provides the following functionality:

  • Access to the source entity
  • Control of whether to copy the source entity
  • Optional matching method
  • Base method copy that copies the source into the target.

The type of the target parameter varies by copier. The following table shows the types of the target parameter for certain copiers.

Copier

Target parameter type

NoteCopier

PolicyPeriod

ModifierCopier

Modifiable

PersonalVehicleCopier

PersonalAutoLine

PolicyDriverCopier

PersonalAutoLine

Note copier: a simple copier

The note copier is an example of a simple copier that copies a Note entity. The note copier is a simple example that you can use for developing your own copiers.

The note copier:

  • Copies a non-revisioned entity.
  • Does not copy any child entities.
  • Copies directly into PolicyPeriod
  • Does not use matching. If a note is copied twice, the note appears twice in the target.
  • Copies a single note from one policy period to another.

See also

Policy driver: a copier for a matching entity

The copier for policy driver is a more complex example that checks for matching drivers.

The PolicyDriverCopier overrides the findMatch method on the abstract gw.api.copy.Copier class. The findMatch method returns a matching PolicyDriver, if any, preventing the copier from creating duplicate drivers.