微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jdk.nashorn.internal.runtime.QuotedStringTokenizer的实例源码

项目:Openjsharp    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = Options.getoptionTemplate(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:openjdk-jdk10    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = getoptionTemplateByName(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:openjdk9    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = getoptionTemplateByName(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:kaziranga    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = Options.getoptionTemplate(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:lookaside_java-1.8.0-openjdk    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = getoptionTemplateByName(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:jdk8u_nashorn    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = getoptionTemplateByName(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:infobip-open-jdk-8    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = Options.getoptionTemplate(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:OLD-OpenJDK8    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = Options.getoptionTemplate(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:nashorn-backport    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = Options.getoptionTemplate(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:nashorn    文件Options.java   
ParsedArg(final String argument) {
    final QuotedStringTokenizer st = new QuotedStringTokenizer(argument,"=");
    if (!st.hasMoretokens()) {
        throw new IllegalArgumentException();
    }

    final String token = st.nextToken();
    this.template = Options.getoptionTemplate(token);
    if (this.template == null) {
        throw new IllegalArgumentException(argument);
    }

    value = "";
    if (st.hasMoretokens()) {
        while (st.hasMoretokens()) {
            value += st.nextToken();
            if (st.hasMoretokens()) {
                value += ':';
            }
        }
    } else if ("boolean".equals(this.template.getType())) {
        value = "true";
    }
}
项目:Openjsharp    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,'{','}');
        final QuotedStringTokenizer keyvaluePairs = new QuotedStringTokenizer(value,",");

        while (keyvaluePairs.hasMoretokens()) {
            final String                keyvalue = keyvaluePairs.nextToken();
            final QuotedStringTokenizer st       = new QuotedStringTokenizer(keyvalue,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:openjdk-jdk10    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            case "repeated":
                this.repeated = true;
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }

    if (this.repeated && !"string".equals(this.type)) {
        throw new IllegalArgumentException("repeated option should be of type string: " + this.name);
    }
}
项目:openjdk9    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:kaziranga    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:jdk8u_nashorn    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:infobip-open-jdk-8    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:OLD-OpenJDK8    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:nashorn-backport    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}
项目:nashorn    文件OptionTemplate.java   
private void parse(final String origValue) {
    String value = origValue.trim();

    try {
        value = OptionTemplate.strip(value,"=");
            final String                keyToken = st.nextToken();
            final String                arg      = st.nextToken();

            switch (keyToken) {
            case "is_undocumented":
                this.isUndocumented = Boolean.parseBoolean(arg);
                break;
            case "name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.name = arg;
                break;
            case "short_name":
                if (!arg.startsWith("-")) {
                    throw new IllegalArgumentException(arg);
                }
                this.shortName = arg;
                break;
            case "desc":
                this.description = arg;
                break;
            case "params":
                this.params = arg;
                break;
            case "type":
                this.type = arg.toLowerCase(Locale.ENGLISH);
                break;
            case "default":
                this.defaultValue = arg;
                break;
            case "dependency":
                this.dependency = arg;
                break;
            case "conflict":
                this.conflict = arg;
                break;
            case "value_next_arg":
                this.valueNextArg = Boolean.parseBoolean(arg);
                break;
            default:
                throw new IllegalArgumentException(keyToken);
            }
        }

        // default to boolean if no type is given
        if (this.type == null) {
            this.type = "boolean";
        }

        if (this.params == null && "boolean".equals(this.type)) {
            this.params = "[true|false]";
        }

    } catch (final Exception e) {
        throw new IllegalArgumentException(origValue);
    }

    if (name == null && shortName == null) {
        throw new IllegalArgumentException(origValue);
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。