|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.groiss.fileimport.ImportHandler
public abstract class ImportHandler
Abstract class for defining a import handler.
Constructor Summary | |
---|---|
ImportHandler()
|
Method Summary | |
---|---|
void |
afterImport(java.util.Map<java.lang.String,java.lang.Object> m,
Persistent 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,
Persistent o)
|
boolean |
beforeUpdate(java.util.Map<java.lang.String,java.lang.Object> m,
Persistent o)
|
Persistent |
getExistingObject(java.lang.Object key,
java.util.Map<java.lang.String,java.lang.Object> values,
java.util.Map<java.lang.Object,Persistent> 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(Persistent o)
will be called if the keyField property isn't set |
void |
prepareFile(java.io.File f)
use this if you want to modify the file first |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImportHandler()
Method Detail |
---|
public boolean beforeInsert(java.util.Map<java.lang.String,java.lang.Object> m, Persistent o)
m
- the map with all the datao
- the object which will be inserted
true
if object shoul be inserted, false
otherwisepublic boolean beforeUpdate(java.util.Map<java.lang.String,java.lang.Object> m, Persistent o)
m
- the map with all the datao
- the object which will be updated
true
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 data
public java.lang.Object getKey(Persistent o)
o
- the object
public 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 data
true
if import should continue, false
otheriwsepublic void afterImport(java.util.Map<java.lang.String,java.lang.Object> m, Persistent 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,Persistent> 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
-objects
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |