atg.core.util
Class PagePattern

java.lang.Object
  extended by atg.core.util.PagePattern

public class PagePattern
extends java.lang.Object

A compiled representation of a filesystem globbing expression, together with logic that tests whether an input string matches the pattern.

A filesystem globbing expression is a highly simplified regular expression whose only special character is *. As with filesystem globbing, * matches any sequence of characters except /. Therefore, the pattern /site/*.jsp matches /site/home.jsp and /site/home.page.jsp but does not match /site/common/home.jsp.

Backslash serves as a quoting character: any character preceeded by a backslash, including *, will be matched literally. Quoting the backslash character itself matches a single backslash in the input string.

A typical invocation sequence looks like this:

 PagePattern p = PagePattern.compile("/site/*.jsp");
 boolean matched = p.matches("/site/index.jsp");
 


Field Summary
static java.lang.String CLASS_VERSION
           
protected  atg.core.util.PagePattern.Segment[] mSegments
           
 
Method Summary
static PagePattern compile(java.lang.String pExpr)
          Compile a filesystem globbing expression to an internal format designed for fast matching against an input string.
static void main(java.lang.String[] args)
           
 boolean matches(java.lang.String pInput)
          Query whether an input string matches the filesystem globbing expression used to create this PagePattern.
 java.lang.String toString()
          Render a human readable version of a PagePattern for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

mSegments

protected atg.core.util.PagePattern.Segment[] mSegments
Method Detail

toString

public java.lang.String toString()
Render a human readable version of a PagePattern for debugging purposes.

Overrides:
toString in class java.lang.Object

compile

public static PagePattern compile(java.lang.String pExpr)
Compile a filesystem globbing expression to an internal format designed for fast matching against an input string.

Parameters:
pExpr - A filesystem globbing expression, in which * may be used to match any sequence of characters except /, and backslash may be used to quote any character including * and itself.
Returns:
A compiled PagePattern object suitable for use in matching input strings against a filesystem globbing expression.

matches

public boolean matches(java.lang.String pInput)
Query whether an input string matches the filesystem globbing expression used to create this PagePattern.

Parameters:
pInput - The input string to match.
Returns:
True if the input string matches the expression used to create this PagePattern, false otherwise.

main

public static void main(java.lang.String[] args)