Java 类javax.tools.OptionChecker 实例源码

项目:OpenJSharp    文件:SchemaGenerator.java   
public static JavacOptions parse(OptionChecker primary, OptionChecker secondary, String... arguments) {
    List<String> recognizedOptions = new ArrayList<String>();
    List<String> unrecognizedOptions = new ArrayList<String>();
    List<String> classNames = new ArrayList<String>();
    List<File> files = new ArrayList<File>();
    for (int i = 0; i < arguments.length; i++) {
        String argument = arguments[i];
        int optionCount = primary.isSupportedOption(argument);
        if (optionCount < 0) {
            optionCount = secondary.isSupportedOption(argument);
        }
        if (optionCount < 0) {
            File file = new File(argument);
            if (file.exists())
                files.add(file);
            else if (SourceVersion.isName(argument))
                classNames.add(argument);
            else
                unrecognizedOptions.add(argument);
        } else {
            for (int j = 0; j < optionCount + 1; j++) {
                int index = i + j;
                if (index == arguments.length) throw new IllegalArgumentException(argument);
                recognizedOptions.add(arguments[index]);
            }
            i += optionCount;
        }
    }
    return new JavacOptions(recognizedOptions, classNames, files, unrecognizedOptions);
}
项目:openjdk-jdk10    文件:SchemaGenerator.java   
public static JavacOptions parse(OptionChecker primary, OptionChecker secondary, String... arguments) {
    List<String> recognizedOptions = new ArrayList<String>();
    List<String> unrecognizedOptions = new ArrayList<String>();
    List<String> classNames = new ArrayList<String>();
    List<File> files = new ArrayList<File>();
    for (int i = 0; i < arguments.length; i++) {
        String argument = arguments[i];
        int optionCount = primary.isSupportedOption(argument);
        if (optionCount < 0) {
            optionCount = secondary.isSupportedOption(argument);
        }
        if (optionCount < 0) {
            File file = new File(argument);
            if (file.exists())
                files.add(file);
            else if (SourceVersion.isName(argument))
                classNames.add(argument);
            else
                unrecognizedOptions.add(argument);
        } else {
            for (int j = 0; j < optionCount + 1; j++) {
                int index = i + j;
                if (index == arguments.length) throw new IllegalArgumentException(argument);
                recognizedOptions.add(arguments[index]);
            }
            i += optionCount;
        }
    }
    return new JavacOptions(recognizedOptions, classNames, files, unrecognizedOptions);
}
项目:openjdk9    文件:SchemaGenerator.java   
public static JavacOptions parse(OptionChecker primary, OptionChecker secondary, String... arguments) {
    List<String> recognizedOptions = new ArrayList<String>();
    List<String> unrecognizedOptions = new ArrayList<String>();
    List<String> classNames = new ArrayList<String>();
    List<File> files = new ArrayList<File>();
    for (int i = 0; i < arguments.length; i++) {
        String argument = arguments[i];
        int optionCount = primary.isSupportedOption(argument);
        if (optionCount < 0) {
            optionCount = secondary.isSupportedOption(argument);
        }
        if (optionCount < 0) {
            File file = new File(argument);
            if (file.exists())
                files.add(file);
            else if (SourceVersion.isName(argument))
                classNames.add(argument);
            else
                unrecognizedOptions.add(argument);
        } else {
            for (int j = 0; j < optionCount + 1; j++) {
                int index = i + j;
                if (index == arguments.length) throw new IllegalArgumentException(argument);
                recognizedOptions.add(arguments[index]);
            }
            i += optionCount;
        }
    }
    return new JavacOptions(recognizedOptions, classNames, files, unrecognizedOptions);
}
项目:lookaside_java-1.8.0-openjdk    文件:SchemaGenerator.java   
public static JavacOptions parse(OptionChecker primary, OptionChecker secondary, String... arguments) {
    List<String> recognizedOptions = new ArrayList<String>();
    List<String> unrecognizedOptions = new ArrayList<String>();
    List<String> classNames = new ArrayList<String>();
    List<File> files = new ArrayList<File>();
    for (int i = 0; i < arguments.length; i++) {
        String argument = arguments[i];
        int optionCount = primary.isSupportedOption(argument);
        if (optionCount < 0) {
            optionCount = secondary.isSupportedOption(argument);
        }
        if (optionCount < 0) {
            File file = new File(argument);
            if (file.exists())
                files.add(file);
            else if (SourceVersion.isName(argument))
                classNames.add(argument);
            else
                unrecognizedOptions.add(argument);
        } else {
            for (int j = 0; j < optionCount + 1; j++) {
                int index = i + j;
                if (index == arguments.length) throw new IllegalArgumentException(argument);
                recognizedOptions.add(arguments[index]);
            }
            i += optionCount;
        }
    }
    return new JavacOptions(recognizedOptions, classNames, files, unrecognizedOptions);
}
项目:infobip-open-jdk-8    文件:SchemaGenerator.java   
public static JavacOptions parse(OptionChecker primary, OptionChecker secondary, String... arguments) {
    List<String> recognizedOptions = new ArrayList<String>();
    List<String> unrecognizedOptions = new ArrayList<String>();
    List<String> classNames = new ArrayList<String>();
    List<File> files = new ArrayList<File>();
    for (int i = 0; i < arguments.length; i++) {
        String argument = arguments[i];
        int optionCount = primary.isSupportedOption(argument);
        if (optionCount < 0) {
            optionCount = secondary.isSupportedOption(argument);
        }
        if (optionCount < 0) {
            File file = new File(argument);
            if (file.exists())
                files.add(file);
            else if (SourceVersion.isName(argument))
                classNames.add(argument);
            else
                unrecognizedOptions.add(argument);
        } else {
            for (int j = 0; j < optionCount + 1; j++) {
                int index = i + j;
                if (index == arguments.length) throw new IllegalArgumentException(argument);
                recognizedOptions.add(arguments[index]);
            }
            i += optionCount;
        }
    }
    return new JavacOptions(recognizedOptions, classNames, files, unrecognizedOptions);
}
项目:OLD-OpenJDK8    文件:SchemaGenerator.java   
public static JavacOptions parse(OptionChecker primary, OptionChecker secondary, String... arguments) {
    List<String> recognizedOptions = new ArrayList<String>();
    List<String> unrecognizedOptions = new ArrayList<String>();
    List<String> classNames = new ArrayList<String>();
    List<File> files = new ArrayList<File>();
    for (int i = 0; i < arguments.length; i++) {
        String argument = arguments[i];
        int optionCount = primary.isSupportedOption(argument);
        if (optionCount < 0) {
            optionCount = secondary.isSupportedOption(argument);
        }
        if (optionCount < 0) {
            File file = new File(argument);
            if (file.exists())
                files.add(file);
            else if (SourceVersion.isName(argument))
                classNames.add(argument);
            else
                unrecognizedOptions.add(argument);
        } else {
            for (int j = 0; j < optionCount + 1; j++) {
                int index = i + j;
                if (index == arguments.length) throw new IllegalArgumentException(argument);
                recognizedOptions.add(arguments[index]);
            }
            i += optionCount;
        }
    }
    return new JavacOptions(recognizedOptions, classNames, files, unrecognizedOptions);
}