Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 1&1 Internet AG, Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package net.oneandone.jasmin.model;
public final class Parser {
    public static void parseComment(String strList<StringdependsList<Stringcalls)  throws IOException {
        final String prefix = "/* jasmin";
        int idx;
        String key;
        String value;
        if (!str.startsWith(prefix)) {
            throw new IOException("missing jasmin comment");
        idx = str.indexOf("*/");
        if (idx == -1) {
            throw new IOException("jasmin comment is not closed");
        for (String[] line : parse(str.substring(prefix.length(), idx))) {
            key = line[0];
            value = line[1];
            if ("depend".equals(key)) {
            } else if ("call".equals(key)) {
            } else {
                throw new IOException("unknown key: " + key);
    private static final Separator NL = Separator.on('\n').trim().skipEmpty();
    public static List<String[]> parse(String strthrows IOException {
        int idx;
        List<String[]> result;
        result = new ArrayList<>();
        for (String line : .split(str)) {
            idx = line.indexOf('=');
            if (idx == -1) {
                throw new IOException("malformed jasmin comment: missing '=' in line '" + line + "'");
            result.add(new String[] { line.substring(0, idx).trim(), line.substring(idx + 1).trim() });
        return result;
    private Parser() {
New to GrepCode? Check out our FAQ X