org.alfresco.jcr.item
Class JCRPatternMatch
java.lang.Object
org.alfresco.jcr.item.JCRPatternMatch
- All Implemented Interfaces:
- QNamePattern
public class JCRPatternMatch
- extends java.lang.Object
- implements QNamePattern
Checks if the QName matches the passed JCR pattern.
The pattern may be a full name or a partial name with one or more wildcard
characters ("*"), or a disjunction (using the "|" character to represent
logical OR) of these. For example,
isMatch("jcr:* | myapp:report | my doc")
Note that leading and trailing whitespace around a disjunct is ignored,
but whitespace within a disjunct forms part of the pattern to be matched.
The EBNF for namePattern is:
namePattern ::= disjunct {'|' disjunct}
disjunct ::= name [':' name]
name ::= '*' | ['*'] fragment {'*' fragment} ['*']
fragment ::= char {char}
char ::= nonspace | ' '
nonspace ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *)
Method Summary |
boolean |
isMatch(QName qname)
Checks if the given qualified name matches the pattern represented
by this instance |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JCRPatternMatch
public JCRPatternMatch(java.lang.String pattern,
NamespacePrefixResolver resolver)
- Construct
- Parameters:
pattern
- JCR Patternresolver
- Namespace Prefix Resolver
isMatch
public boolean isMatch(QName qname)
- Description copied from interface:
QNamePattern
- Checks if the given qualified name matches the pattern represented
by this instance
- Specified by:
isMatch
in interface QNamePattern
- Parameters:
qname
- the instance to check
- Returns:
- Returns true if the qname matches this pattern
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.