Klasse PathElement

java.lang.Object
org.xbib.net.path.spring.element.PathElement
Bekannte direkte Unterklassen:
CaptureTheRestPathElement, CaptureVariablePathElement, LiteralPathElement, RegexPathElement, SeparatorPathElement, SingleCharWildcardedPathElement, WildcardPathElement, WildcardTheRestPathElement

public abstract class PathElement extends Object
Common supertype for the Ast nodes created to represent a path pattern.
  • Felddetails

  • Konstruktordetails

    • PathElement

      public PathElement(int pos, char separator)
      Create a new path element.
      Parameter:
      pos - the position where this path element starts in the pattern data
      separator - the separator in use in the path pattern
  • Methodendetails

    • matches

      public abstract boolean matches(int candidatePos, MatchingContext matchingContext)
      Attempt to match this path element.
      Parameter:
      candidatePos - the current position within the candidate path
      matchingContext - encapsulates context for the match including the candidate
      Gibt zurück:
      true if it matches, otherwise false
    • getNormalizedLength

      public abstract int getNormalizedLength()
      Return the length of the path element where captures are considered to be one character long.
      Gibt zurück:
      the normalized length
    • getChars

      public abstract char[] getChars()
    • getCaptureCount

      public int getCaptureCount()
      Return the number of variables captured by the path element.
    • getWildcardCount

      public int getWildcardCount()
      Return the number of wildcard elements (*, ?) in the path element.
    • getScore

      public int getScore()
      Return the score for this PathElement, combined score is used to compare parsed patterns.
    • isNoMorePattern

      protected final boolean isNoMorePattern()
      Return if the there are no more PathElements in the pattern.
      Gibt zurück:
      true if the there are no more elements