Class ReferenceUtil

java.lang.Object
jmri.jmrit.logixng.util.ReferenceUtil

public class ReferenceUtil extends Object
Utility methods to handle references
  • Constructor Details

  • Method Details

    • isReference

      public static boolean isReference(String value)
      Checks if the parameter is a reference or not.
      Parameters:
      value - the string to check
      Returns:
      true if value has a reference. falsw otherwise
    • unescapeString

      protected static String unescapeString(String value, int startIndex, int endIndex)
    • getValue

      protected static String getValue(String reference, int startIndex, ReferenceUtil.IntRef endIndex)
      Get the value. The value ends either with end of string, or with any of the characters comma, left square bracket, right square bracket or right curly bracket. These characters may be escaped and should then be ignored.
      Parameters:
      reference - the reference
      startIndex - where in the string the value starts, since the reference string may contain several references.
      endIndex - index of the end of the value. This is an output parameter.
      Returns:
      the value
    • getReferenceOrValue

      protected static String getReferenceOrValue(SymbolTable symbolTable, String reference, int startIndex, ReferenceUtil.IntRef endIndex)
      Get the reference or the value.The value ends either with end of string, or with any of the characters comma, left square bracket, right square bracket or right curly bracket. These characters may be escaped and should then be ignored.
      Parameters:
      symbolTable - the symbol table
      reference - the reference
      startIndex - where in the string the value starts, since the reference string may contain several references.
      endIndex - index of the end of the value. This is an output parameter.
      Returns:
      the value
    • getReference

      protected static String getReference(SymbolTable symbolTable, String reference, int startIndex, ReferenceUtil.IntRef endIndex)
      Get the value of a reference
      Parameters:
      symbolTable - the symbol table
      reference - the reference
      startIndex - where in the string the reference starts, since the reference string may contain several references.
      endIndex - index of the end of the reference. This is an output parameter.
      Returns:
      the value of the reference
    • getReference

      @CheckReturnValue @Nonnull public static String getReference(SymbolTable symbolTable, String reference)