dsto.dfc.swing.text.selection
Class RegexSelector

java.lang.Object
  extended by dsto.dfc.swing.text.selection.RegexSelector
All Implemented Interfaces:
Convertable, PatternSelector, Selector, Copyable, Serializable, Cloneable

public class RegexSelector
extends Object
implements PatternSelector, Convertable, Copyable, Serializable

Selector that uses Perl 5 compatible regular expressions. Implemented using ORO Matcher 1.1 http://www.quateams.com/oro/software/OROMatcher1.1.html.

Version:
$Revision$
Author:
mpp
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface dsto.dfc.swing.text.selection.PatternSelector
PatternSelector.SelectAllSelector
 
Field Summary
static ValueConverter CONVERTER
           
 
Fields inherited from interface dsto.dfc.swing.text.selection.PatternSelector
SELECT_ALL
 
Constructor Summary
RegexSelector()
           
RegexSelector(String regex)
           
RegexSelector(String regex, boolean caseSensitive)
           
 
Method Summary
 Object clone()
          Create a completely separate copy of this object and any mutable objects owned by the object.
 ValueConverter getConverter()
          Return a converter that at least supports conversion to and from String.
 String getExpression()
           
 boolean matches(Object value)
          True if this pattern selector matches the given value.
 void setExpression(String regex)
          Set the regex expression
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONVERTER

public static final ValueConverter CONVERTER
Constructor Detail

RegexSelector

public RegexSelector()
              throws IllegalFormatException
Throws:
IllegalFormatException

RegexSelector

public RegexSelector(String regex)
              throws IllegalFormatException
Throws:
IllegalFormatException

RegexSelector

public RegexSelector(String regex,
                     boolean caseSensitive)
              throws IllegalFormatException
Throws:
IllegalFormatException
Method Detail

matches

public boolean matches(Object value)
Description copied from interface: PatternSelector
True if this pattern selector matches the given value.

Specified by:
matches in interface PatternSelector
Specified by:
matches in interface Selector

toString

public String toString()
Overrides:
toString in class Object

getConverter

public ValueConverter getConverter()
Description copied from interface: PatternSelector
Return a converter that at least supports conversion to and from String.

Specified by:
getConverter in interface Convertable
Specified by:
getConverter in interface PatternSelector

getExpression

public String getExpression()
Specified by:
getExpression in interface PatternSelector

setExpression

public void setExpression(String regex)
                   throws IllegalFormatException
Set the regex expression

Specified by:
setExpression in interface PatternSelector
Parameters:
regex - String value
Throws:
IllegalFormatException

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: Copyable
Create a completely separate copy of this object and any mutable objects owned by the object.

NOTE: subclasses should not remove the CloneNotSupportedException throws clause if they themselves support subclassing: removing the CloneNotSupportedException declaration stops subclasses from indicating that a clone was not possible.

Specified by:
clone in interface Copyable
Overrides:
clone in class Object
Throws:
CloneNotSupportedException - if the clone failed or is not possible.


Copyright © 2008 Commonwealth of Australia