jaskell.parsec.common.Fail Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaskell-java8 Show documentation
Show all versions of jaskell-java8 Show documentation
This is a utils library for java 8 project.
It include parsec combinators and sql generators library.
package jaskell.parsec.common;
import jaskell.parsec.ParsecException;
import java.io.EOFException;
/**
* Created by Mars Liu on 2016-01-07.
* Fail 不改变 state , 直接抛出预设的异常.
*/
public class Fail implements Parsec {
private final String message;
@Override
public E parse(State s) throws EOFException, ParsecException {
throw s.trap(message);
}
public Fail(String msg, Object...objects) {
message = String.format(msg, objects);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy