feedback / send your comments
mail to luc peuvrier
chat channel
joafip users mailing list
forums

BACK TO THE INDEX

RETOUR A L'INDEX

Conversion for import and data model change (since 3.0.0)

Conversion definition example

to be done
mail

net.sf.joafip.export_import.Enum300 no more exist in data model #2, instance replaced by null:
1;net.sf.joafip.export_import.Enum300;2

Conversion format

The conversion definition are in a utf8 text file.

The conversion format is:

( "dmid" means "data model identifier" )

<conversion definition> :
  <conversion element> * 

<conversion element>    :  <class name conversion element>
                        |  <field name conversion element>
                        |  <old class field declaration>
 

<class name conversion element> : <previous dmid> ';'  <class name> ';' <next dmid> <convert_to_opt>

<convert_to_opt> : empty | ';' <class name> <converter_opt>

<converter_opt> : empty | ';' <class name>

<field name conversion element> :
 
  <previous dmid> ';'  <field name> ';' <next dmid> ';' <field name>

<old class field declaration> :

  <previous dmid> ';' <class name> '#*;' <next dmid> ; <field list>

<field list>

  <type>:<field name> [ ',' <type>:<field name> ] *

A line feed can be added after the semicolumn or column.

<class name> is write using java class name syntax, example:

java.util.LinkedList

the class 'LinkedList' in 'java.util' package    


<field name> is write using java class name syntax, example:

net.sf.joafip.store.service.ObjectForTest#val

the 'val' field of class 'net.sf.joafip.store.service.ObjectForTest'


net.sf.joafip.store.service.ObjectForTest#val:net.sf.joafip.store.service.MyValue

the 'val' field of class 'net.sf.joafip.store.service.ObjectForTest' having 'net.sf.joafip.store.service.MyValue' type

special notation for removed field : 'net.sf.joafip.store.service.ObjectForTest#'
only possible for last field name definition of <field name conversion element>


<type>

a primitive type

boolean, byte, short, int, long, float, double

a class, for example

java.lang.String
net.sf.joafip.store.service.ObjectForTest

type can be interface


The converter is not use by import process.
The field replacement are not managed by conversion on the fly.
The converter is use for conversion on the fly and converter class implements net.sf.joafip.store.service.conversion.IConverter interface.


feedback / send your comments
mail to luc peuvrier
chat channel
joafip users mailing list
forums

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
© 2007-2012, joafip