类 PathElement

java.lang.Object
cn.taketoday.web.util.pattern.PathElement
直接已知子类:
CaptureTheRestPathElement, CaptureVariablePathElement, LiteralPathElement, RegexPathElement, SeparatorPathElement, SingleCharWildcardedPathElement, WildcardPathElement, WildcardTheRestPathElement

abstract class PathElement extends Object
Common supertype for the Ast nodes created to represent a path pattern.
从以下版本开始:
4.0
作者:
Andy Clement
  • 字段详细资料

    • WILDCARD_WEIGHT

      protected static final int WILDCARD_WEIGHT
      另请参阅:
    • CAPTURE_VARIABLE_WEIGHT

      protected static final int CAPTURE_VARIABLE_WEIGHT
      另请参阅:
    • pos

      protected final int pos
    • separator

      protected final char separator
    • next

      @Nullable protected PathElement next
    • prev

      @Nullable protected PathElement prev
  • 构造器详细资料

    • PathElement

      PathElement(int pos, char separator)
      Create a new path element.
      参数:
      pos - the position where this path element starts in the pattern data
      separator - the separator in use in the path pattern
  • 方法详细资料

    • matches

      public abstract boolean matches(int candidatePos, PathPattern.MatchingContext matchingContext)
      Attempt to match this path element.
      参数:
      candidatePos - the current position within the candidate path
      matchingContext - encapsulates context for the match including the candidate
      返回:
      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.
      返回:
      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.
    • isLiteral

      public boolean isLiteral()
      Return whether this PathElement can be strictly compared against another element for matching.
    • isNoMorePattern

      protected final boolean isNoMorePattern()
      Return if the there are no more PathElements in the pattern.
      返回:
      true if the there are no more elements