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);
    }
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...