Klasse CaptureVariablePathElement

java.lang.Object
org.xbib.net.path.spring.element.PathElement
org.xbib.net.path.spring.element.CaptureVariablePathElement

public class CaptureVariablePathElement extends PathElement
A path element representing capturing a piece of the path as a variable. In the pattern '/foo/{bar}/goo' the {bar} is represented as a CaptureVariablePathElement. There must be at least one character to bind to the variable.
  • Konstruktordetails

    • CaptureVariablePathElement

      public CaptureVariablePathElement(int pos, char[] captureDescriptor, boolean caseSensitive, char separator)
      Create a new CaptureVariablePathElement instance.
      Parameter:
      pos - the position in the pattern of this capture element
      captureDescriptor - is of the form {AAAAA[:pattern]}
  • Methodendetails

    • matches

      public boolean matches(int pathIndex, MatchingContext matchingContext)
      Beschreibung aus Klasse kopiert: PathElement
      Attempt to match this path element.
      Angegeben von:
      matches in Klasse PathElement
      Parameter:
      pathIndex - 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
    • getVariableName

      public String getVariableName()
    • getNormalizedLength

      public int getNormalizedLength()
      Beschreibung aus Klasse kopiert: PathElement
      Return the length of the path element where captures are considered to be one character long.
      Angegeben von:
      getNormalizedLength in Klasse PathElement
      Gibt zurück:
      the normalized length
    • getChars

      public char[] getChars()
      Angegeben von:
      getChars in Klasse PathElement
    • getWildcardCount

      public int getWildcardCount()
      Beschreibung aus Klasse kopiert: PathElement
      Return the number of wildcard elements (*, ?) in the path element.
      Setzt außer Kraft:
      getWildcardCount in Klasse PathElement
    • getCaptureCount

      public int getCaptureCount()
      Beschreibung aus Klasse kopiert: PathElement
      Return the number of variables captured by the path element.
      Setzt außer Kraft:
      getCaptureCount in Klasse PathElement
    • getScore

      public int getScore()
      Beschreibung aus Klasse kopiert: PathElement
      Return the score for this PathElement, combined score is used to compare parsed patterns.
      Setzt außer Kraft:
      getScore in Klasse PathElement
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object