Class ParameterRefParser

java.lang.Object
de.aristaflow.adept2.model.common.paramref.ParameterRefParser
Direct Known Subclasses:
ParameterRefReplacer

public class ParameterRefParser extends Object
Parser for strings containing parameter references. The advantage compared to ParameterRefTools.findParameterReferences(String, EnumSet) is that the parser provides position information (start and end index of parameter reference).

Instances are created using ParameterRefTools.getParser(String, EnumSet) or other specialised variants like SystemDataTools.getParser(String).

Author:
Patrick Schmidt
  • Method Details

    • getParameterisedString

      public String getParameterisedString()
      Returns the parameterised string being processed.
      Returns:
      the parameterised string being processed
    • findNext

      public boolean findNext()
      Finds the next parameter reference.
      Returns:
      if a next parameter reference was found
    • getParameterRef

      public ParameterRef getParameterRef()
      Returns the current parameter reference.
      Returns:
      the current parameter reference
    • getDataType

      public ProcessConstants.AdeptDataType getDataType()
      Returns the data type of the current parameter reference.
      Returns:
      the data type of the current parameter reference
    • getUdtName

      public String getUdtName()
      Returns the name of the user-defined data type of the current parameter reference.
      Returns:
      the name of the user-defined data type of the current parameter reference
    • getName

      public String getName()
      Returns the name of the current parameter reference.
      Returns:
      the name of the current parameter reference
    • getStart

      public int getStart()
      Returns the start index of the current match, i.e. the first %. This is index is valid in the original (unprocessed) string.
      Returns:
      the start index of the current match
    • getEnd

      public int getEnd()
      Returns the index one position after the final character in the current match, i.e. one position after the final %. This is index is valid in the original (unprocessed) string.
      Returns:
      the index one position after the final character in the current match