-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathPatternMatcher.java
More file actions
43 lines (36 loc) · 1.1 KB
/
PatternMatcher.java
File metadata and controls
43 lines (36 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Contibuted by Andrea Aime
* (C) Copyright 2005 Diomidis Spinellis
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
*/
package org.umlgraph.doclet;
import java.util.regex.Pattern;
import com.sun.javadoc.ClassDoc;
/**
* Matches classes performing a regular expression match on the qualified class
* name
* @author wolf
*/
public class PatternMatcher implements ClassMatcher {
Pattern pattern;
public PatternMatcher(Pattern pattern) {
this.pattern = pattern;
}
public boolean matches(ClassDoc cd) {
return matches(cd.toString());
}
public boolean matches(String name) {
return pattern.matcher(name).matches();
}
}