org.alfresco.service.namespace
Class RegexQNamePattern

java.lang.Object
  extended by org.alfresco.service.namespace.RegexQNamePattern
All Implemented Interfaces:
QNamePattern

public class RegexQNamePattern
extends java.lang.Object
implements QNamePattern

Provides matching between qnames using regular expression matching.

A simple convenience pattern matcher is also provided that will match any qname.

See Also:
String.matches(java.lang.String)

Field Summary
static QNamePattern MATCH_ALL
          A helper pattern matcher that will match all qnames
 
Constructor Summary
RegexQNamePattern(java.lang.String combinedPattern)
           
RegexQNamePattern(java.lang.String namespaceUriPattern, java.lang.String localNamePattern)
           
 
Method Summary
 boolean isMatch(QName qname)
          Checks if the given qualified name matches the pattern represented by this instance
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MATCH_ALL

public static final QNamePattern MATCH_ALL
A helper pattern matcher that will match all qnames

Constructor Detail

RegexQNamePattern

public RegexQNamePattern(java.lang.String namespaceUriPattern,
                         java.lang.String localNamePattern)
Parameters:
namespaceUriPattern - a regex pattern that will be applied to the namespace URI
localNamePattern - a regex pattern that will be applied to the local name

RegexQNamePattern

public RegexQNamePattern(java.lang.String combinedPattern)
Parameters:
combinedPattern - a regex pattern that will be applied to the full qname string representation
See Also:
QName.toString()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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 value to check against this pattern
Returns:
Returns true if the regex pattern provided match thos of the provided qname


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.