Class MatchString

  • Direct Known Subclasses:
    MatchString

    public class MatchString
    extends java.lang.Object
    Utility class for handlers to determine, based on the URL, if the current request should be processed.

    Properties:

    prefix
    The url prefix the url must match (defaults to "/").
    suffix
    The url suffix the url must match (defaults to "").
    glob
    The glob pattern the url must match. If defined, this overrides both prefix and suffix.
    match
    The reqular expression pattern the url must match. If defined, this overrides glob.
    ignoreCase
    If present and match is defined, this causes the regular expression match to be case insensitive. By default, case counts.
    invert
    If true, the sense of the comparison is reversed
    • Constructor Summary

      Constructors 
      Constructor Description
      MatchString​(java.lang.String propsPrefix)
      Create a matcher for per-request URL checking.
      MatchString​(java.lang.String propsPrefix, java.util.Properties props)
      Create a matcher for one-time-only checking.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean match​(java.lang.String url)
      See if this is our url.
      boolean match​(java.lang.String url, java.util.Properties props)
      See if this is our url.
      java.lang.String prefix()
      Return our prefix
      java.lang.String toString()
      print nicely
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MatchString

        public MatchString​(java.lang.String propsPrefix)
        Create a matcher for per-request URL checking. This constructer is used if the properties are to be evaluated on each request.
        Parameters:
        propsPrefix - The prefix to use in the properties object.
      • MatchString

        public MatchString​(java.lang.String propsPrefix,
                           java.util.Properties props)
        Create a matcher for one-time-only checking. This constructor is used if the properties are to be computed only once, at "init" time.
        Parameters:
        propsPrefix - The prefix to use in the properties object.
        props - The table to find the properties in.
    • Method Detail

      • match

        public boolean match​(java.lang.String url)
        See if this is our url. Use this version for properties evaluated only at init time.
      • match

        public boolean match​(java.lang.String url,
                             java.util.Properties props)
        See if this is our url. Use this version for properties evaluated at each request.
      • prefix

        public java.lang.String prefix()
        Return our prefix
      • toString

        public java.lang.String toString()
        print nicely
        Overrides:
        toString in class java.lang.Object