org.eclipse.core.internal.propertytester
Class StringMatcher

java.lang.Object
  extended by org.eclipse.core.internal.propertytester.StringMatcher

public class StringMatcher
extends java.lang.Object

A string pattern matcher, supporting "*" and "?" wild cards.

Since:
3.2

Constructor Summary
StringMatcher(java.lang.String pattern)
          StringMatcher constructor takes in a String object that is a simple pattern which may contain '*' for 0 and many characters and '?' for exactly one character.
 
Method Summary
 boolean match(java.lang.String text)
          Given the starting (inclusive) and the ending (exclusive) positions in the text, determine if the given substring matches with aPattern
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringMatcher

public StringMatcher(java.lang.String pattern)
StringMatcher constructor takes in a String object that is a simple pattern which may contain '*' for 0 and many characters and '?' for exactly one character. Literal '*' and '?' characters must be escaped in the pattern e.g., "\*" means literal "*", etc. Escaping any other character (including the escape character itself), just results in that character in the pattern. e.g., "\a" means "a" and "\\" means "\" If invoking the StringMatcher with string literals in Java, don't forget escape characters are represented by "\\".

Parameters:
pattern - the pattern to match text against
Method Detail

match

public boolean match(java.lang.String text)
Given the starting (inclusive) and the ending (exclusive) positions in the text, determine if the given substring matches with aPattern

Parameters:
text - a String object that contains the substring to match
Returns:
true if the specified portion of the text matches the pattern