public static void main ( String argv [ ] ) throws Exception { String idlFile = null ; String pkgName = null ; String outDir = null ; String nsPkgName = null ; boolean allImmutable = false ; List < String > immutableSubstr = new ArrayList < String > ( ) ; for ( int i = 0 ; i < argv . length ; i ++ ) { if ( argv [ i ] . equals ( "-j" ) ) { idlFile = argv [ ++ i ] ; } else if ( argv [ i ] . equals ( "-p" ) ) { pkgName = argv [ ++ i ] ; } else if ( argv [ i ] . equals ( "-o" ) ) { outDir = argv [ ++ i ] ; } else if ( argv [ i ] . equals ( "-b" ) ) { nsPkgName = argv [ ++ i ] ; } else if ( argv [ i ] . equals ( "-s" ) ) { immutableSubstr . add ( argv [ ++ i ] ) ; } else if ( argv [ i ] . equals ( "-i" ) ) { allImmutable = true ; } } if ( isBlank ( idlFile ) || isBlank ( pkgName ) || isBlank ( outDir ) ) { out ( "Usage: java com.bitmechanic.barrister.Idl2Java -j [idl file] -p [Java package prefix] -b [Java package prefix for namespaced entities] -o [out dir] -i -s [immutable class substr]" ) ; System . exit ( 1 ) ; } if ( nsPkgName == null ) { nsPkgName = pkgName ; } new Idl2Java ( idlFile , pkgName , nsPkgName , outDir , allImmutable , immutableSubstr ) ; }
Runs the code generator on the command line .