|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.SimonPattern
public final class SimonPattern
Matches Simon name patterns from configuration. Patterns can contain wildcard (*) that can be placed in following fashions:
Manager.ROOT_SIMON_NAME (root Simon)
* - matches anything
something - matches exactly something
*something - matches if tested name ends with something
something* - matches if tested name starts with something
*something* - matches if tested name contains something anywhere
something*else - matches if tested name starts with something and ends with else
SimonException with the message about invalid Simon pattern
| Field Summary | |
|---|---|
private String |
all
Used if complete match is expected. |
private String |
end
Used if tail should match. |
private static String |
INVALID_PATTERN
|
private String |
middle
Used if anything inside (or everything) should match. |
private String |
pattern
Original pattern from the configuration. |
private String |
start
Used if head should match. |
private static String |
WILDCARD_STAR
|
| Constructor Summary | |
|---|---|
SimonPattern(String pattern)
Creates Simon name pattern used to match config file entries. |
|
| Method Summary | |
|---|---|
static SimonPattern |
create(String pattern)
Factory method that creates Simon name pattern - or returns null if parameter is null. |
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
matches(String name)
Checks if Simon name matches this pattern. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final String WILDCARD_STAR
private String pattern
private String all
private String start
private String end
private String middle
private static final String INVALID_PATTERN
| Constructor Detail |
|---|
public SimonPattern(String pattern)
pattern - Simon name pattern
SimonException - if pattern is not valid (runtime exception)| Method Detail |
|---|
public static SimonPattern create(String pattern)
null if parameter is null.
pattern - Simon name pattern as string
null if pattern parameter is nullpublic boolean matches(String name)
name - tested name
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||