private void generateOpen ( String schemaName ) { MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "open" ) . addModifiers ( Modifier . PUBLIC , Modifier . STATIC ) . returns ( className ( schemaName ) ) ; methodBuilder . addJavadoc ( "Retrieve data source instance and open it.\n" ) ; methodBuilder . addJavadoc ( "@return opened dataSource instance.\n" ) ; methodBuilder . addStatement ( "$L instance=getInstance()" , schemaName ) ; methodBuilder . addStatement ( "instance.openWritableDatabase()" ) ; methodBuilder . addCode ( "return instance;\n" ) ; classBuilder . addMethod ( methodBuilder . build ( ) ) ; }
Generate open .