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

chesspresso.pgn.PGNSimpleErrorHandler Maven / Gradle / Ivy

/*
 * Chessplorer-Lib - an open source chess library written in Java
 * Copyright (C) 2016 Chessplorer.org
 * Copyright (C) 2012-2016 Gerhard Kalab
 * Copyright (C) 2002-2003 Bernhard Seybold
 *
 * This software is published under the terms of the LGPL Software License,
 * a copy of which has been included with this distribution in the LICENSE.txt
 * file.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 */
package chesspresso.pgn;

import java.io.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Simple implementation of a PGN error handler. Write the errors and warnings
 * directly to a configured print stream.
 *
 * @author Bernhard Seybold
 * @author Andreas Rudolph
 */
public class PGNSimpleErrorHandler implements PGNErrorHandler
{
    private final static Logger LOGGER = LoggerFactory.getLogger( PGNSimpleErrorHandler.class );
    private PrintStream m_out;

    /*================================================================================*/

    public PGNSimpleErrorHandler(PrintStream out)
    {
        m_out = out;
    }

    /*================================================================================*/

    public void handleError(PGNSyntaxError error)
    {
        m_out.println(error);
    }

    public void handleWarning(PGNSyntaxError warning)
    {
        m_out.println(warning);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy