public class CallMetadata
extends java.lang.Object
Constructor and Description |
---|
CallMetadata(ReaderInterface source,
int sourcePosition)
Constructs a new CallMetadata using the given source and the source position.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getAbsSourcePosition()
Returns the absolute character position of the call where line breaks count as one (or two, respectively) characters.
|
SourcePosition |
getFilePosition()
Returns line and column of the call.
|
java.lang.String |
getInputKey()
Returns the input key of the call.
|
java.lang.String |
getScriptFile()
Returns the script file in which the call took place.
|
java.lang.String |
getStringRepresentation()
Returns a user-readable string representation of the call meta data.
|
boolean |
hasInputKey()
Tells whether or not an input key was set.
|
CallMetadata |
setInputKey(java.lang.String inputKey,
boolean allowOverwrite)
Sets the input key of the call.
|
void |
setLocation(ReaderInterface source,
int sourcePosition)
Sets the reference to the source code and the position (in characters) of the call
|
java.lang.String |
toString() |
public CallMetadata(ReaderInterface source, int sourcePosition)
source
- a reference to the source code in which the call took place.sourcePosition
- the character position at which the call took place.public java.lang.String getInputKey()
public java.lang.String getScriptFile()
public CallMetadata setInputKey(java.lang.String inputKey, boolean allowOverwrite)
inputKey
- the input key of the call.allowOverwrite
- if true, then another call of setInputKey overwrites the key. If false, then further calls of setInputKey have no effect.public void setLocation(ReaderInterface source, int sourcePosition)
source
- a reference to the source codesourcePosition
- the character position of the callpublic java.lang.Integer getAbsSourcePosition()
public SourcePosition getFilePosition()
public boolean hasInputKey()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStringRepresentation()