org.radeox.regex
Class Matcher

java.lang.Object
  extended byorg.radeox.regex.Matcher
Direct Known Subclasses:
JdkMatcher

public abstract class Matcher
extends java.lang.Object


Constructor Summary
Matcher()
           
 
Method Summary
abstract  boolean contains()
          Test if a regular expression matches parts of the input
static Matcher create(java.lang.String input, Pattern pattern)
          Create a new matcher object, depending on the implementation
abstract  boolean matches()
          Test if a regular expression matches the complete input
abstract  java.lang.String substitute(java.lang.String substitution)
          Replace all matches in the input with a string substitution.
abstract  java.lang.String substitute(Substitution substitution)
          Replace all matches in the input with a substitution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matcher

public Matcher()
Method Detail

create

public static Matcher create(java.lang.String input,
                             Pattern pattern)
Create a new matcher object, depending on the implementation

Parameters:
input - Input to match regular expressions agains
pattern - Regular expression pattern
Returns:
A Matcher implementation

substitute

public abstract java.lang.String substitute(Substitution substitution)
Replace all matches in the input with a substitution. For every match substition.handleMatch is called.

Parameters:
substitution - Code which handles every substitution
Returns:
String with all matches substituted

substitute

public abstract java.lang.String substitute(java.lang.String substitution)
Replace all matches in the input with a string substitution.

Parameters:
substitution - String to replace all matches
Returns:
String with all matches substituted

matches

public abstract boolean matches()
Test if a regular expression matches the complete input

Returns:
True if the regex matches the complete input

contains

public abstract boolean contains()
Test if a regular expression matches parts of the input

Returns:
True if the regex matches a part of the input


Copyright © 2003 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved.