com.ibm.xtools.emf.query.conditions.strings
Class StringRegularExpressionValue
java.lang.Object
com.ibm.xtools.emf.query.conditions.Condition
com.ibm.xtools.emf.query.conditions.strings.StringCondition
com.ibm.xtools.emf.query.conditions.strings.StringValue
com.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.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
stringsadpater
- The StringAdapter
to use to get a
String out of evaluated Objects
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
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2004. All rights reserved.