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

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.CdmSingleAttributeMapperBase
              extended by eu.etaxonomy.cdm.io.common.mapping.DbSingleAttributeImportMapperBase<DbImportStateBase<?,?>,AnnotatableEntity>
                  extended by eu.etaxonomy.cdm.io.common.mapping.DbImportAnnotationMapper
All Implemented Interfaces:
IDbImportMapper<DbImportStateBase<?,?>,AnnotatableEntity>

public class DbImportAnnotationMapper
extends DbSingleAttributeImportMapperBase<DbImportStateBase<?,?>,AnnotatableEntity>
implements IDbImportMapper<DbImportStateBase<?,?>,AnnotatableEntity>

This class maps a database attribute to CDM annotation added to the target class TODO maybe this class should not inherit from DbSingleAttributeImportMapperBase as it does not map to a single attribute

Version:
1.0
Author:
a.mueller

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.DbSingleAttributeImportMapperBase
destinationMethod, ignore, importMapperHelper, obligatory, targetClass
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.CdmSingleAttributeMapperBase
defaultValue
 
Method Summary
protected  AnnotatableEntity doInvoke(AnnotatableEntity annotatableEntity, Object dbValue)
           
protected  AnnotationType getAnnotationType(CdmImportBase<?,?> currentImport, UUID uuid, String label, String text, String labelAbbrev)
           
 Class<String> getTypeClass()
           
 void initialize(DbImportStateBase<?,?> state, Class<? extends CdmBase> destinationClass)
           
 AnnotatableEntity invoke(ResultSet rs, AnnotatableEntity annotatableEntity)
           
static DbImportAnnotationMapper NewInstance(String dbAttributeString, AnnotationType annotationType)
           
static DbImportAnnotationMapper NewInstance(String dbAttributeString, AnnotationType annotationType, Language language)
           
static DbImportAnnotationMapper NewInstance(String dbAttributeString, UUID uuid, String label, String text, String labelAbbrev)
          FIXME Warning: the annotation type creation is not yet implemented
static DbImportAnnotationMapper NewInstance(String dbAttributeString, UUID uuid, String label, String text, String labelAbbrev, Language language)
          * FIXME Warning: the annotation type creation is not yet implemented
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.DbSingleAttributeImportMapperBase
checkDbColumnExists, getDbColumnIntegerInfo, getDbValue, getState, getStringDbValue, getTableName, getTargetClass, getValue
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.CdmSingleAttributeMapperBase
getDestinationAttribute, getDestinationAttributeList, getDestinationAttributes, getSourceAttribute, getSourceAttributeList, getSourceAttributes
 
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
 

Method Detail

NewInstance

public static DbImportAnnotationMapper NewInstance(String dbAttributeString,
                                                   UUID uuid,
                                                   String label,
                                                   String text,
                                                   String labelAbbrev)
FIXME Warning: the annotation type creation is not yet implemented

Parameters:
dbAttributeString -
uuid -
label -
text -
labelAbbrev -
Returns:

NewInstance

public static DbImportAnnotationMapper NewInstance(String dbAttributeString,
                                                   UUID uuid,
                                                   String label,
                                                   String text,
                                                   String labelAbbrev,
                                                   Language language)
* FIXME Warning: the annotation type creation is not yet implemented

Parameters:
dbAttributeString -
uuid -
label -
text -
labelAbbrev -
Returns:

NewInstance

public static DbImportAnnotationMapper NewInstance(String dbAttributeString,
                                                   AnnotationType annotationType)
Parameters:
dbAttributeString -
annotationType -
Returns:

NewInstance

public static DbImportAnnotationMapper NewInstance(String dbAttributeString,
                                                   AnnotationType annotationType,
                                                   Language language)
Parameters:
dbAttributeString -
annotationType -
language -
Returns:

initialize

public void initialize(DbImportStateBase<?,?> state,
                       Class<? extends CdmBase> destinationClass)
Specified by:
initialize in interface IDbImportMapper<DbImportStateBase<?,?>,AnnotatableEntity>
Overrides:
initialize in class DbSingleAttributeImportMapperBase<DbImportStateBase<?,?>,AnnotatableEntity>

invoke

public AnnotatableEntity invoke(ResultSet rs,
                                AnnotatableEntity annotatableEntity)
                         throws SQLException
Specified by:
invoke in interface IDbImportMapper<DbImportStateBase<?,?>,AnnotatableEntity>
Overrides:
invoke in class DbSingleAttributeImportMapperBase<DbImportStateBase<?,?>,AnnotatableEntity>
Throws:
SQLException

doInvoke

protected AnnotatableEntity doInvoke(AnnotatableEntity annotatableEntity,
                                     Object dbValue)
Overrides:
doInvoke in class DbSingleAttributeImportMapperBase<DbImportStateBase<?,?>,AnnotatableEntity>

getAnnotationType

protected AnnotationType getAnnotationType(CdmImportBase<?,?> currentImport,
                                           UUID uuid,
                                           String label,
                                           String text,
                                           String labelAbbrev)
Parameters:
service -
uuid -
label -
text -
labelAbbrev -
Returns:

getTypeClass

public Class<String> getTypeClass()
Specified by:
getTypeClass in class CdmSingleAttributeMapperBase


Copyright © 2007-2013 EDIT. All Rights Reserved.