net.percederberg.mibble
Class LogEntry

java.lang.Object
  extended bynet.percederberg.mibble.LogEntry

public class LogEntry
extends java.lang.Object

A log entry. This class holds all the details in an error or a warning log entry.

Since:
2.0

Field Summary
static int ERROR
          The error log entry type constant.
static int INTERNAL_ERROR
          The internal error log entry type constant.
static int WARNING
          The warning log entry type constant.
 
Constructor Summary
LogEntry(int type, FileLocation location, java.lang.String message)
          Creates a new log entry.
 
Method Summary
 int getColumnNumber()
          Returns the column number.
 java.io.File getFile()
          Returns the file this entry applies to.
 int getLineNumber()
          Returns the line number.
 java.lang.String getMessage()
          Returns the log entry message.
 int getType()
          Returns the log entry type.
 boolean isError()
          Checks if this is an error log entry.
 boolean isWarning()
          Checks if this is a warning log entry.
 java.lang.String readLine()
          Reads the line from the referenced file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERNAL_ERROR

public static final int INTERNAL_ERROR
The internal error log entry type constant.

See Also:
Constant Field Values

ERROR

public static final int ERROR
The error log entry type constant.

See Also:
Constant Field Values

WARNING

public static final int WARNING
The warning log entry type constant.

See Also:
Constant Field Values
Constructor Detail

LogEntry

public LogEntry(int type,
                FileLocation location,
                java.lang.String message)
Creates a new log entry.

Parameters:
type - the log entry type
location - the log entry file reference
message - the log entry message
Method Detail

isError

public boolean isError()
Checks if this is an error log entry.

Returns:
true if this is an error log entry, or false otherwise

isWarning

public boolean isWarning()
Checks if this is a warning log entry.

Returns:
true if this is a warning log entry, or false otherwise

getType

public int getType()
Returns the log entry type.

Returns:
the log entry type
See Also:
INTERNAL_ERROR, ERROR, WARNING

getFile

public java.io.File getFile()
Returns the file this entry applies to.

Returns:
the file affected

getLineNumber

public int getLineNumber()
Returns the line number.

Returns:
the line number

getColumnNumber

public int getColumnNumber()
Returns the column number.

Returns:
the column number

getMessage

public java.lang.String getMessage()
Returns the log entry message.

Returns:
the log entry message

readLine

public java.lang.String readLine()
Reads the line from the referenced file. If the file couldn't be opened or read correctly, null will be returned. The line will NOT contain the terminating '\n' character.

Returns:
the line read, or null if not found