org.deegree.commons.utils
Class QNameUtils
java.lang.Object
org.deegree.commons.utils.QNameUtils
public class QNameUtils
- extends Object
Provides some utility methods for working with qualified names.
- Version:
- $Revision: 24534 $, $Date: 2010-05-21 18:47:23 +0200 (Fri, 21 May 2010) $
- Author:
- Markus Schneider, last edited by: $Author: mschneider $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QNameUtils
public QNameUtils()
toString
public static String toString(QName qName)
- Returns a string representation that includes the prefix (if present).
- Parameters:
qName
- qualified name, must not be null
- Returns:
- string representation, never
null
findBestMatch
public static QName findBestMatch(QName present,
Collection<QName> candidates)
- Finds the best possible match for a
QName
in a collection of QName
s.
Performs the following checks in order:
- exact match, same namespace, same local part
- different namespace, same prefix, same local part
- different namespace, different prefix, same local part
- Parameters:
present
- name for which to find the best match, must not be null
candidates
- available candidates, must not be null
- Returns:
- best match, or
null
if no match can be found at all
Copyright © 2011. All Rights Reserved.