org.jruby.runtime.regexp
Class IRegexpAdapter

java.lang.Object
  extended byorg.jruby.runtime.regexp.IRegexpAdapter
Direct Known Subclasses:
GNURegexpAdapter, JDKRegexpAdapter, ORORegexpAdapter

public abstract class IRegexpAdapter
extends java.lang.Object

Regexp adapter base class. This abstract class is used to decouple ruby from the actual regexp engine


Constructor Summary
IRegexpAdapter()
           
 
Method Summary
abstract  void compile(Ruby ruby, java.lang.String pattern)
          Compile the regex.
static java.lang.Class getAdapter(java.lang.String shortName)
           
abstract  boolean getCasefold()
          Get whether matches are case-insensitive or not
abstract  IRubyObject search(Ruby runtime, java.lang.String target, int startPos)
          Does the given argument match the pattern?
abstract  void setCasefold(boolean set)
          Set whether matches should be case-insensitive or not
abstract  void setExtended(boolean set)
          Set whether patterns can contain comments and extra whitespace
abstract  void setMultiline(boolean set)
          Set whether the dot metacharacter should match newlines
 java.lang.String unextend(java.lang.String re)
          Removes whitespace and comments from regexp, for those libs (like gnu.regexp) that don't support extended syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IRegexpAdapter

public IRegexpAdapter()
Method Detail

getAdapter

public static java.lang.Class getAdapter(java.lang.String shortName)

compile

public abstract void compile(Ruby ruby,
                             java.lang.String pattern)
                      throws RegexpError
Compile the regex.

Throws:
RegexpError

setCasefold

public abstract void setCasefold(boolean set)
Set whether matches should be case-insensitive or not


getCasefold

public abstract boolean getCasefold()
Get whether matches are case-insensitive or not


setExtended

public abstract void setExtended(boolean set)
Set whether patterns can contain comments and extra whitespace


setMultiline

public abstract void setMultiline(boolean set)
Set whether the dot metacharacter should match newlines


search

public abstract IRubyObject search(Ruby runtime,
                                   java.lang.String target,
                                   int startPos)
Does the given argument match the pattern?


unextend

public java.lang.String unextend(java.lang.String re)
Removes whitespace and comments from regexp, for those libs (like gnu.regexp) that don't support extended syntax.



Copyright © 2002 Jan Arne Petersen. All Rights Reserved.