org.quattor.pan.dml.functions
Class AbstractMatcher

java.lang.Object
  extended by org.quattor.pan.dml.AbstractOperation
      extended by org.quattor.pan.dml.functions.BuiltInFunction
          extended by org.quattor.pan.dml.functions.AbstractMatcher
All Implemented Interfaces:
Operation
Direct Known Subclasses:
AbstractStaticMatcher, AbstractVariableMatcher

public abstract class AbstractMatcher
extends BuiltInFunction

Determine whether a string matches a given regular expression, using optional matching flags.

Author:
loomis

Field Summary
 
Fields inherited from class org.quattor.pan.dml.functions.BuiltInFunction
name
 
Fields inherited from class org.quattor.pan.dml.AbstractOperation
ops, sourceRange
 
Constructor Summary
protected AbstractMatcher(java.lang.String name, SourceRange sourceRange, Operation... operations)
           
 
Method Summary
protected  java.util.regex.Pattern compilePattern(Element regex, int flags)
          Generate a Pattern from the given string and flags.
protected  int convertMatchFlags(Element opts)
          A utility function to convert a string containing match options to the associated integer with the appropriate bits set.
 
Methods inherited from class org.quattor.pan.dml.functions.BuiltInFunction
throwExceptionIfCompileTimeContext, toString
 
Methods inherited from class org.quattor.pan.dml.AbstractOperation
calculateArgs, calculateTerms, checkInvalidSelfContext, checkRestrictedContext, execute, getOperations, getSourceRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMatcher

protected AbstractMatcher(java.lang.String name,
                          SourceRange sourceRange,
                          Operation... operations)
                   throws SyntaxException
Throws:
SyntaxException
Method Detail

convertMatchFlags

protected int convertMatchFlags(Element opts)
A utility function to convert a string containing match options to the associated integer with the appropriate bits set.

Parameters:
opts - string containing matching flags
Returns:
integer with appropriate bits set

compilePattern

protected java.util.regex.Pattern compilePattern(Element regex,
                                                 int flags)
Generate a Pattern from the given string and flags.

Parameters:
regex - regular expression to compile
flags - matching flags to use for pattern
Returns:
Pattern corresponding to the given regular expression and matching flags


Copyright © 2011 Quattor. All Rights Reserved.