IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.emf.query.conditions.strings
Class StringRegularExpressionValue

java.lang.Object
  extended bycom.ibm.xtools.emf.query.conditions.Condition
      extended bycom.ibm.xtools.emf.query.conditions.strings.StringCondition
          extended bycom.ibm.xtools.emf.query.conditions.strings.StringValue
              extended bycom.ibm.xtools.emf.query.conditions.strings.StringRegularExpressionValue

public class StringRegularExpressionValue
extends StringValue

A StringValue condition subclass that tests for String using regular expression. The arguments being evaluated are adapted to a String first using a StringAdapter and then the string will be compared with the initialization regular expression to see if it matches.


Field Summary
 
Fields inherited from class com.ibm.xtools.emf.query.conditions.Condition
FALSE, TRUE
 
Constructor Summary
StringRegularExpressionValue(String patternStr)
          A simple constructor that takes the regular expression to use for matching.
StringRegularExpressionValue(String patternStr, boolean caseSensitive, StringAdapter adpater)
          A constructor that takes the regular expression to use for matching, a StringAdapter for adapting the evaluated object to string before matching them and a boolean flag indicating whether the pattern matching should be case-sensitive or not.
StringRegularExpressionValue(String patternStr, StringAdapter adpater)
          A constructor that takes the regular expression to use for matching, and a StringAdapter for adapting the evaluated object to string before matching them.
 
Method Summary
protected  Pattern getPattern()
          A getter for the Pattern used by this StringRegularExpressionValue
 boolean isSatisfied(String str)
          Answers whether the argument string matches the regular expression used in initialization of this StringRegularExpressionValue
 
Methods inherited from class com.ibm.xtools.emf.query.conditions.strings.StringValue
getString, isCaseSensitive
 
Methods inherited from class com.ibm.xtools.emf.query.conditions.strings.StringCondition
isSatisfied
 
Methods inherited from class com.ibm.xtools.emf.query.conditions.Condition
AND, EQUIVALENT, IMPLIES, OR, XOR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringRegularExpressionValue

public StringRegularExpressionValue(String patternStr)
A simple constructor that takes the regular expression to use for matching. It defaults to using the StringAdapter.DEFAULT for adapting the evaluated object to string before matching them, and it defaults to being case-sensitive.

Parameters:
patternStr - The regular expression pattern to use for matching strings when evaluating this StringRegularExpressionValue condition

StringRegularExpressionValue

public StringRegularExpressionValue(String patternStr,
                                    StringAdapter adpater)
A constructor that takes the regular expression to use for matching, and a StringAdapter for adapting the evaluated object to string before matching them. It defaults to being case-sensitive.

Parameters:
patternStr - The regular expression pattern to use for matching strings when evaluating this StringRegularExpressionValue condition.
adpater - The StringAdapter to use to get a String out of evaluated Objects

StringRegularExpressionValue

public StringRegularExpressionValue(String patternStr,
                                    boolean caseSensitive,
                                    StringAdapter adpater)
A constructor that takes the regular expression to use for matching, a StringAdapter for adapting the evaluated object to string before matching them and a boolean flag indicating whether the pattern matching should be case-sensitive or not.

Parameters:
patternStr - The regular expression pattern to use for matching strings when evaluating this StringRegularExpressionValue condition.
caseSensitive - a boolean value specifying whether to use case in matching strings
adpater - The StringAdapter to use to get a String out of evaluated Objects
Method Detail

isSatisfied

public boolean isSatisfied(String str)
Answers whether the argument string matches the regular expression used in initialization of this StringRegularExpressionValue

Overrides:
isSatisfied in class StringValue
See Also:
StringCondition.isSatisfied(java.lang.String)

getPattern

protected final Pattern getPattern()
A getter for the Pattern used by this StringRegularExpressionValue

Returns:
Pattern The Pattern generated by compiling the regular expression

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.