public static void main(String[] args) throws IOException, ClassNotFoundException {
        if (args.length == 0) {
            System.out.println("Usage:\n"
                    + "java " + HollowPOJOGenerator.class.getName() + " --arg1=value1 --arg2=value2\n"
                    + "see " + GeneratorArguments.class.getName() + " for available arguments.");
            return;
        }
        HollowWriteStateEngine engine = new HollowWriteStateEngine();
        String packageName = null;
        String pojoClassNameSuffix = null;
        String pathToGeneratedFiles = null;
        HollowObjectMapper mapper = new HollowObjectMapper(engine);
        ArgumentParser<GeneratorArguments> argumentParser = new ArgumentParser(GeneratorArguments.class, args);
        for (ArgumentParser<GeneratorArguments>.ParsedArgument arg : argumentParser.getParsedArguments()) {
            switch (arg.getKey()) {
                case addToDataModel:
                    mapper.initializeTypeState(HollowPOJOGenerator.class.getClassLoader().loadClass(arg.getValue()));
                    break;
                case addSchemaFileToDataModel:
                    HollowWriteStateCreator.readSchemaFileIntoWriteState(arg.getValue(), engine);
                    break;
                case pathToGeneratedFiles:
                    pathToGeneratedFiles = arg.getValue();
                    break;
                case packageName:
                    packageName = arg.getValue();
                    break;
                case pojoClassNameSuffix:
                    pojoClassNameSuffix = arg.getValue();
                    break;
                default:
                    throw new IllegalArgumentException("Unhandled argument " + arg.getKey());
            }
        }
        new HollowPOJOGenerator(packageName, pojoClassNameSuffix, engine).generateFiles(pathToGeneratedFiles);
    }
public static void main ( String [ ] args ) throws IOException , ClassNotFoundException { if ( args . length == 0 ) { System . out . println ( "Usage:\n" + "java " + HollowPOJOGenerator . class . getName ( ) + " --arg1=value1 --arg2=value2\n" + "see " + GeneratorArguments . class . getName ( ) + " for available arguments." ) ; return ; } HollowWriteStateEngine engine = new HollowWriteStateEngine ( ) ; String packageName = null ; String pojoClassNameSuffix = null ; String pathToGeneratedFiles = null ; HollowObjectMapper mapper = new HollowObjectMapper ( engine ) ; ArgumentParser < GeneratorArguments > argumentParser = new ArgumentParser ( GeneratorArguments . class , args ) ; for ( ArgumentParser < GeneratorArguments > . ParsedArgument arg : argumentParser . getParsedArguments ( ) ) { switch ( arg . getKey ( ) ) { case addToDataModel : mapper . initializeTypeState ( HollowPOJOGenerator . class . getClassLoader ( ) . loadClass ( arg . getValue ( ) ) ) ; break ; case addSchemaFileToDataModel : HollowWriteStateCreator . readSchemaFileIntoWriteState ( arg . getValue ( ) , engine ) ; break ; case pathToGeneratedFiles : pathToGeneratedFiles = arg . getValue ( ) ; break ; case packageName : packageName = arg . getValue ( ) ; break ; case pojoClassNameSuffix : pojoClassNameSuffix = arg . getValue ( ) ; break ; default : throw new IllegalArgumentException ( "Unhandled argument " + arg . getKey ( ) ) ; } } new HollowPOJOGenerator ( packageName , pojoClassNameSuffix , engine ) . generateFiles ( pathToGeneratedFiles ) ; }
Usage: java HollowPOJOGenerator --argName1=argValue1 --argName2==argValue2. See {@link GeneratorArguments}
for available arguments.
@param args the arguments
@throws IOException if the POJOs cannot be created
@throws ClassNotFoundException if the class for a data type cannot be loaded