Interface ParameterToken

All Known Subinterfaces:
ParameterReference
All Known Implementing Classes:
EscapedParameterReference, StandardParameterReference, StartCharacterEscape

public interface ParameterToken
A token encountered when parsing Strings for Parameter references. A Token may be a reference to a Parameter, or it may be an "escaped reference" / non-reference.
  • Method Details

    • getStartOffset

      int getStartOffset()
      Returns:
      the 0-based index in the String at which the token begins
    • getEndOffset

      int getEndOffset()
      Returns:
      the 0-based index in the String at which the token ends
    • getText

      String getText()
      Returns:
      the portion of the input text that corresponds to this token
    • isEscapeSequence

      boolean isEscapeSequence()
      Returns:
      true if this token represents an escape sequence such as ##{param} or ## in the case of ###{param} or ####{param}, false if this token does not represent an escape sequence.
    • isParameterReference

      boolean isParameterReference()
      Returns:
      true if this token represents a reference to a Parameter. If this method returns true, then this token can be cast as a ParameterReference.
    • getValue

      String getValue(ParameterLookup lookup)
      Returns the 'value' of the token. If this token is a parameter reference, it will return the value of the Parameter, according to the given Parameter Context. If this token is an Escape Sequence, it will return the un-escaped version of the escape sequence.
      Parameters:
      lookup - the Parameter Lookup to use for looking up values
      Returns:
      the value of the Token