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

com.github.leeonky.dal.compiler.Constants Maven / Gradle / Ivy

package com.github.leeonky.dal.compiler;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import static java.util.Arrays.asList;

public class Constants {
    public static final Set DELIMITER = new HashSet<>(asList('=', '>', '<', '+', '-', '*', '/', ':',
            '&', '|', '!', ',', '(', ')', '[', ']', '{', '}', ' ', '\t', '\n', '\r', '#', '\'', '"'));
    //    TODO missing testing \r
    public static final Set PROPERTY_DELIMITER = new HashSet(DELIMITER) {{
        add('.');
    }};

    public static final Set PROPERTY_DELIMITER_STRING = PROPERTY_DELIMITER.stream().map(Object::toString)
            .collect(Collectors.toSet());

    public static final Set RELAX_PROPERTY_DELIMITER = new HashSet() {{
        addAll(PROPERTY_DELIMITER);
        for (char c : "-+%;".toCharArray()) {
            remove(c);
        }
    }};

    public static final List EXPRESSION_RELAX_STRING_TAIL = asList(" ", "\r", "\t", "\n", ",", "||", "&&");
    public static final List OBJECT_SCOPE_RELAX_STRING_TAIL = asList(" ", "\r", "\t", "\n", ",", "}");
    public static final List LIST_SCOPE_RELAX_STRING_TAIL = asList(" ", "\r", "\t", "\n", ",", "]");
    public static final List TABLE_CELL_RELAX_STRING_TAIL = asList("|", "\n", "\r");

    public static final Set DIGITAL = new HashSet<>(asList('1', '2', '3', '4', '5', '6', '7', '8', '9', '0'));
    public static final Set DIGITAL_OR_MINUS = new HashSet(DIGITAL) {{
        add('-');
    }};
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy