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

io.polaris.core.string.TokenParser Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package io.polaris.core.string;

/**
 * @author Qt
 * @since 1.8,  Aug 11, 2023
 */
public class TokenParser {

	private final String openToken;
	private final String closeToken;
	private final TokenHandler handler;
	private final boolean trimEscapeCharacter;

	public TokenParser(String openToken, String closeToken, TokenHandler handler) {
		this(openToken, closeToken, handler, true);
	}

	public TokenParser(String openToken, String closeToken, TokenHandler handler, boolean trimEscapeCharacter) {
		this.openToken = openToken;
		this.closeToken = closeToken;
		this.handler = handler;
		this.trimEscapeCharacter = trimEscapeCharacter;
	}

	public String parse(String text) {
		return TokenParsers.parse(text, openToken, closeToken, handler, trimEscapeCharacter);
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy