Cleaned up documentation and minor tweaks in Antlr4ErrorLog
This commit is contained in:
parent
5d8d9670df
commit
c30dc20aa5
|
@ -1,9 +1,7 @@
|
|||
/**
|
||||
[The "BSD licence"]
|
||||
|
||||
ANTLR - Copyright (c) 2005-2008 Terence Parr
|
||||
Maven Plugin - Copyright (c) 2009 Jim Idle
|
||||
|
||||
/*
|
||||
[The "BSD license"]
|
||||
Copyright (c) 2012 Terence Parr
|
||||
Copyright (c) 2012 Sam Harwell
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
@ -30,31 +28,35 @@
|
|||
*/
|
||||
package org.antlr.mojo.antlr4;
|
||||
|
||||
import org.antlr.v4.runtime.misc.NotNull;
|
||||
import org.antlr.v4.tool.ANTLRMessage;
|
||||
import org.antlr.v4.tool.ANTLRToolListener;
|
||||
import org.apache.maven.plugin.logging.Log;
|
||||
|
||||
/**
|
||||
* The Maven plexus container gives us a Log logging provider
|
||||
* which we can use to install an error listener for the ANTLR
|
||||
* tool to report errors by.
|
||||
* This implementation of {@link ANTLRToolListener} reports messages to the
|
||||
* {@link Log} instance provided by Maven.
|
||||
*
|
||||
* @author Sam Harwell
|
||||
*/
|
||||
public class Antlr4ErrorLog implements ANTLRToolListener {
|
||||
|
||||
private Log log;
|
||||
private final Log log;
|
||||
|
||||
/**
|
||||
* Instantiate an ANTLR ErrorListner that communicates any messages
|
||||
* it receives to the Maven error sink.
|
||||
* Creates an instance of {@link Antlr4ErrorLog}.
|
||||
*
|
||||
* @param log The Maven Error Log
|
||||
* @param log The Maven log
|
||||
*/
|
||||
public Antlr4ErrorLog(Log log) {
|
||||
public Antlr4ErrorLog(@NotNull Log log) {
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an informational message to the Maven log sink.
|
||||
* {@inheritDoc}
|
||||
* <p/>
|
||||
* This implementation passes the message to the Maven log.
|
||||
*
|
||||
* @param message The message to send to Maven
|
||||
*/
|
||||
@Override
|
||||
|
@ -63,7 +65,9 @@ public class Antlr4ErrorLog implements ANTLRToolListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sends an error message from ANTLR analysis to the Maven Log sink.
|
||||
* {@inheritDoc}
|
||||
* <p/>
|
||||
* This implementation passes the message to the Maven log.
|
||||
*
|
||||
* @param message The message to send to Maven.
|
||||
*/
|
||||
|
@ -73,7 +77,9 @@ public class Antlr4ErrorLog implements ANTLRToolListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sends a warning message to the Maven log sink.
|
||||
* {@inheritDoc}
|
||||
* <p/>
|
||||
* This implementation passes the message to the Maven log.
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue