public abstract class ImportHandler<T extends Persistent>
extends java.lang.Object
Constructor and Description |
---|
ImportHandler() |
Modifier and Type | Method and Description |
---|---|
void |
afterImport(java.util.Map<java.lang.String,java.lang.Object> m,
T o)
called after importing a row
|
boolean |
beforeImport(java.util.Map<java.lang.String,java.lang.Object> m,
java.util.Map<java.lang.String,java.lang.Object> ext)
called after reading a row
|
boolean |
beforeInsert(java.util.Map<java.lang.String,java.lang.Object> m,
T o) |
boolean |
beforeUpdate(java.util.Map<java.lang.String,java.lang.Object> m,
T o) |
Persistent |
getExistingObject(java.lang.Object key,
java.util.Map<java.lang.String,java.lang.Object> values,
java.util.Map<java.lang.Object,T> cache)
should return the corresponding
Persistent object for the current
datarow. |
java.lang.Object |
getKey(java.util.Map<java.lang.String,java.lang.Object> map)
will be called if the keyField property isn't set
|
java.lang.Object |
getKey(T o)
will be called if the keyField property isn't set
|
java.lang.String |
importCompleted()
Called after import is done.
|
void |
init(com.groiss.fileimport.ImportContext ctx)
called before any work starts
|
void |
prepareFile(java.io.File f)
use this if you want to modify the file first
|
public void init(com.groiss.fileimport.ImportContext ctx)
ctx
- contains information about the current contextpublic boolean beforeInsert(java.util.Map<java.lang.String,java.lang.Object> m, T o)
m
- the map with all the datao
- the object which will be insertedtrue
if object shoul be inserted, false
otherwisepublic boolean beforeUpdate(java.util.Map<java.lang.String,java.lang.Object> m, T o)
m
- the map with all the datao
- the object which will be updatedtrue
if object shoul be updated, false
otherwisepublic java.lang.Object getKey(java.util.Map<java.lang.String,java.lang.Object> map)
map
- the map with all the datapublic java.lang.Object getKey(T o)
o
- the objectpublic boolean beforeImport(java.util.Map<java.lang.String,java.lang.Object> m, java.util.Map<java.lang.String,java.lang.Object> ext)
m
- the data for this rowext
- the extended datatrue
if import should continue, false
otheriwsepublic void afterImport(java.util.Map<java.lang.String,java.lang.Object> m, T o)
m
- the data mapo
- the imported objectpublic void prepareFile(java.io.File f)
f
- the filepublic Persistent getExistingObject(java.lang.Object key, java.util.Map<java.lang.String,java.lang.Object> values, java.util.Map<java.lang.Object,T> cache)
Persistent
object for the current
datarow.key
- the key for the object either from keyField
or getKey(Map)
values
- the values of the current rowcache
- the cached targetClass
-objectspublic java.lang.String importCompleted()
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.