public static boolean matchesQName ( QName regQName , QName targetQName , boolean ignorePrefix ) { if ( regQName == null || targetQName == null ) { return false ; } if ( "*" . equals ( getQNameString ( regQName ) ) ) { return true ; } // if the name space or the prefix is not equal, just return false; if ( ! ( regQName . getNamespaceURI ( ) . equals ( targetQName . getNamespaceURI ( ) ) ) || ! ( ignorePrefix || regQName . getPrefix ( ) . equals ( targetQName . getPrefix ( ) ) ) ) { return false ; } if ( regQName . getLocalPart ( ) . contains ( "*" ) ) { return Pattern . matches ( mapPattern ( regQName . getLocalPart ( ) ) , targetQName . getLocalPart ( ) ) ; } else if ( regQName . getLocalPart ( ) . equals ( targetQName . getLocalPart ( ) ) ) { return true ; } return false ; }
Check whether the regQName matches the targetQName