AbstractParser.java 574 B

123456789101112131415161718192021222324
  1. package de.jplag;
  2. import org.slf4j.Logger;
  3. import org.slf4j.LoggerFactory;
  4. /**
  5. * Abstract parser class. Counts errors and manages an error consumer.
  6. * @author Emeric Kwemou
  7. */
  8. public abstract class AbstractParser {
  9. protected int errors = 0;
  10. public final Logger logger;
  11. protected AbstractParser() {
  12. this.logger = LoggerFactory.getLogger(this.getClass());
  13. }
  14. /**
  15. * @return true if the last parse call (which could be still ongoing) lead to one or more errors.
  16. */
  17. public boolean hasErrors() {
  18. return errors != 0;
  19. }
  20. }