public void write ( Configuration config ) throws IOException { pp . startDocument ( ) ; pp . startElement ( "duke" , null ) ; // FIXME: here we should write the objects, but that's not // possible with the current API. we don't need that for the // genetic algorithm at the moment, but it would be useful. pp . startElement ( "schema" , null ) ; writeElement ( "threshold" , "" + config . getThreshold ( ) ) ; if ( config . getMaybeThreshold ( ) != 0.0 ) writeElement ( "maybe-threshold" , "" + config . getMaybeThreshold ( ) ) ; for ( Property p : config . getProperties ( ) ) writeProperty ( p ) ; pp . endElement ( "schema" ) ; String dbclass = config . getDatabase ( false ) . getClass ( ) . getName ( ) ; AttributeListImpl atts = new AttributeListImpl ( ) ; atts . addAttribute ( "class" , "CDATA" , dbclass ) ; pp . startElement ( "database" , atts ) ; pp . endElement ( "database" ) ; if ( config . isDeduplicationMode ( ) ) for ( DataSource src : config . getDataSources ( ) ) writeDataSource ( src ) ; else { pp . startElement ( "group" , null ) ; for ( DataSource src : config . getDataSources ( 1 ) ) writeDataSource ( src ) ; pp . endElement ( "group" ) ; pp . startElement ( "group" , null ) ; for ( DataSource src : config . getDataSources ( 2 ) ) writeDataSource ( src ) ; pp . endElement ( "group" ) ; } pp . endElement ( "duke" ) ; pp . endDocument ( ) ; }
Writes the given configuration to the given file .