All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sql2o.quirks.parameterparsing.impl.ForwardSlashCommentParser Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
package org.sql2o.quirks.parameterparsing.impl;

/**
 * Created by lars on 22.09.2014.
 */
public class ForwardSlashCommentParser extends AbstractCommentParser {

    private boolean commentAlmostEnded;

    @Override
    protected void init() {
        commentAlmostEnded = false;
    }

    @Override
    public boolean canParse(char c, String sql, int idx) {
        return sql.length() > idx + 1 && c == '/' && sql.charAt(idx + 1) == '*';
    }

    @Override
    public boolean isEndComment(char c) {
        if (commentAlmostEnded && c == '/') return true;
        commentAlmostEnded = c == '*';
        return false;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy