eu.etaxonomy.cdm.io.common.mapping
Class DbImportMarkerCreationMapper

java.lang.Object
  extended by eu.etaxonomy.cdm.io.common.mapping.CdmMapperBase
      extended by eu.etaxonomy.cdm.io.common.mapping.CdmAttributeMapperBase
          extended by eu.etaxonomy.cdm.io.common.mapping.MultipleAttributeMapperBase<CdmSingleAttributeMapperBase>
              extended by eu.etaxonomy.cdm.io.common.mapping.DbImportMultiAttributeMapperBase<CREATE,STATE>
                  extended by eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase<SUPPLEMENT,STATE>
                      extended by eu.etaxonomy.cdm.io.common.mapping.DbImportSupplementCreationMapperBase<Marker,AnnotatableEntity,DbImportStateBase<?,?>,MarkerType>
                          extended by eu.etaxonomy.cdm.io.common.mapping.DbImportMarkerCreationMapper
All Implemented Interfaces:
IDbImportMapper<DbImportStateBase<?,?>,Marker>

public class DbImportMarkerCreationMapper
extends DbImportSupplementCreationMapperBase<Marker,AnnotatableEntity,DbImportStateBase<?,?>,MarkerType>

Object creation mapper which creates a marker.

Version:
1.0
Author:
a.mueller

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportSupplementCreationMapperBase
addOriginalSourceId, dbSupplementedObjectAttribute, dbSupplementValueAttribute, supplementType
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase
dbIdAttribute, objectToCreateNamespace
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportMultiAttributeMapperBase
importMapperHelper
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.MultipleAttributeMapperBase
singleMappers
 
Constructor Summary
protected DbImportMarkerCreationMapper(String dbSupplementedObjectAttribute, String supplementedObjectNamespace, String dbSupplementValueAttribute, String dbIdAttribute, MarkerType supplementType)
           
 
Method Summary
protected  boolean addSupplement(Marker marker, AnnotatableEntity annotatableEntity, String id)
          Adds the supplement to the supplementable entity.
protected  Marker createObject(ResultSet rs)
          This method creates the object to be created.
static DbImportMarkerCreationMapper NewInstance(String dbMarkedObjectAttribute, String markedObjectNamespace)
          Creates a marker mapper which creates an empty marker.
static DbImportMarkerCreationMapper NewInstance(String dbMarkedObjectAttribute, String markedObjectNamespace, String dbMarkerValueAttribute, String dbIdAttribute, MarkerType markerType)
          Creates a marker mapper which creates a marker and sets the marker flag and the marker type and adds an Annotation holding the original source id
protected  void setSupplementValue(ResultSet rs, Marker marker)
           
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportSupplementCreationMapperBase
addOriginalSource, doInvoke
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase
getTransformer, invoke
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportMultiAttributeMapperBase
getForeignKey, getRelatedObject, getRelatedObject, getState, initialize
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.MultipleAttributeMapperBase
getDestinationAttributeList, getDestinationAttributes, getSourceAttributeList, getSourceAttributes, getStringDbValue
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.CdmAttributeMapperBase
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbImportMarkerCreationMapper

protected DbImportMarkerCreationMapper(String dbSupplementedObjectAttribute,
                                       String supplementedObjectNamespace,
                                       String dbSupplementValueAttribute,
                                       String dbIdAttribute,
                                       MarkerType supplementType)
Parameters:
dbSupplementValueAttribute -
dbSupplementedObjectAttribute -
dbIdAttribute -
supplementedObjectNamespace -
supplementType -
Method Detail

NewInstance

public static DbImportMarkerCreationMapper NewInstance(String dbMarkedObjectAttribute,
                                                       String markedObjectNamespace)
Creates a marker mapper which creates an empty marker.

Parameters:
dbMarkedObjectAttribute -
markedObjectNamespace -
Returns:

NewInstance

public static DbImportMarkerCreationMapper NewInstance(String dbMarkedObjectAttribute,
                                                       String markedObjectNamespace,
                                                       String dbMarkerValueAttribute,
                                                       String dbIdAttribute,
                                                       MarkerType markerType)
Creates a marker mapper which creates a marker and sets the marker flag and the marker type and adds an Annotation holding the original source id

Parameters:
dbMarkedObjectAttribute -
markedObjectNamespace -
dbMarkerValueAttribute -
dbIdAttribute -
markerType -
Returns:

addSupplement

protected boolean addSupplement(Marker marker,
                                AnnotatableEntity annotatableEntity,
                                String id)
Description copied from class: DbImportSupplementCreationMapperBase
Adds the supplement to the supplementable entity. Returns falls if supplementable entity is null

Specified by:
addSupplement in class DbImportSupplementCreationMapperBase<Marker,AnnotatableEntity,DbImportStateBase<?,?>,MarkerType>
Parameters:
marker - the supplement (e.g. an instance of class Extension)
annotatableEntity - the supplementable entity (e.g. an IdentifiableEntity in case of a supplement of type Extension
id - the supplementableEntity original source id (needed for verbose logging)

setSupplementValue

protected void setSupplementValue(ResultSet rs,
                                  Marker marker)
                           throws SQLException
Specified by:
setSupplementValue in class DbImportSupplementCreationMapperBase<Marker,AnnotatableEntity,DbImportStateBase<?,?>,MarkerType>
Throws:
SQLException

createObject

protected Marker createObject(ResultSet rs)
                       throws SQLException
Description copied from class: DbImportObjectCreationMapperBase
This method creates the object to be created. It needs to be implemented by the concrete classes. E.g. if you have a TaxonNameCreation class which inherits from this class you need to implement createObject by creating an empty taxon name.

Specified by:
createObject in class DbImportObjectCreationMapperBase<Marker,DbImportStateBase<?,?>>
Parameters:
rs - The result set
Returns:
The object to be created
Throws:
SQLException


Copyright © 2007-2013 EDIT. All Rights Reserved.