de.dante.util
Class Locator

java.lang.Object
  extended byde.dante.util.Locator
All Implemented Interfaces:
java.io.Serializable

public class Locator
extends java.lang.Object
implements java.io.Serializable

The locator is the container for the information about the name of a resource and the current line number.

Version:
$Revision: 1.11 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
Serialized Form

Constructor Summary
Locator(java.lang.String resource, int lineNo, java.lang.String currentLine, int currentLinePointer)
          Creates a new object.
 
Method Summary
 java.lang.String getLine()
          Getter for the line.
 int getLineNumber()
          Getter for the line number.
 int getLinePointer()
          Getter for the line pointer.
 java.lang.String getResourceName()
          Getter for the resource name.
 java.lang.String toString()
          Return a printable representation of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Locator

public Locator(java.lang.String resource,
               int lineNo,
               java.lang.String currentLine,
               int currentLinePointer)
Creates a new object.

Parameters:
resource - the name of the resource; e.g. the file name
lineNo - the line number
currentLine - the current line of input
currentLinePointer - the current position in the line of input
Method Detail

getLine

public java.lang.String getLine()
Getter for the line.

Returns:
the line.

getLinePointer

public int getLinePointer()
Getter for the line pointer. The line pointer is the position within the line at which something happened.

Returns:
the line pointer.

getResourceName

public java.lang.String getResourceName()
Getter for the resource name. The resource name can be unset. In this case null is returned.

Returns:
the resource name or null

getLineNumber

public int getLineNumber()
Getter for the line number.

Returns:
the line number

toString

public java.lang.String toString()
Return a printable representation of this instance. The result contains the file name and the line number separated by colon. This is the Unix style of presenting a file position. If the file name is null then it is treated as if it where the empty string.

See Also:
Object.toString()