Package com.evolveum.midpoint.util
Class QNameUtil
- java.lang.Object
-
- com.evolveum.midpoint.util.QNameUtil
-
public class QNameUtil extends Object
QName <-> URI conversion.Very simplistic but better than nothing.
- Author:
- semancik
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQNameUtil.QNameInfo
-
Field Summary
Fields Modifier and Type Field Description static charDEFAULT_QNAME_URI_SEPARATOR_CHARstatic TraceLOGGER
-
Constructor Summary
Constructors Constructor Description QNameUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancompareQName(QName qname, Node node)static booleancontains(Collection<? extends QName> col, QName qname)static booleancontains(QName[] array, QName qname)static Collection<QName>createCollection(QName... qnames)static StringescapeElementName(String name)static <V> VgetByQName(@NotNull Map<QName,V> map, @NotNull QName key)Finds value in the map by QName key usingmatch(QName, QName).static StringgetLocalPart(QName name)static QNamegetNodeQName(Node node)static booleanhasNamespace(@NotNull QName name)static booleanisPrefixUndeclared(String namespacePrefix)static booleanisQualified(QName name)static booleanisTolerateUndeclaredPrefixes()static booleanisUnqualified(String uri)static booleanisUnqualified(QName name)static booleanisUri(String string)static StringmarkPrefixAsUndeclared(String namespacePrefix)static booleanmatch(QName a, QName b)Matching with considering wildcard namespace (null).static booleanmatch(QName a, QName b, boolean caseInsensitive)static booleanmatchAny(QName nameToFind, Collection<? extends QName> names)static booleanmatchUri(String uri1, String uri2)static booleanmatchWithUri(QName qname, String uri)Matches QName with a URI representation.static booleannoNamespace(@NotNull QName name)static QNamenullNamespace(QName qname)static StringprettyPrint(QName... qnames)static StringqNameToUri(QName qname)static StringqNameToUri(QName qname, boolean unqualifiedStartsWithHash)static StringqNameToUri(QName qname, boolean unqualifiedStartsWithHash, char separatorChar)static QNamequalifyIfNeeded(QName name, String defaultNamespace)static booleanremove(Collection<? extends QName> col, QName qname)static voidreportUndeclaredNamespacePrefix(String prefix, String context)static QNameresolveNs(QName a, Collection<QName> col)static voidsetTemporarilyTolerateUndeclaredPrefixes(Boolean value)static voidsetTolerateUndeclaredPrefixes(boolean value)static booleanunorderedCollectionMatch(Collection<QName> a, Collection<QName> b)static QNameunqualify(QName name)static @NotNull QNameuriToQName(@NotNull String uri, boolean allowUnqualified)static QNameuriToQName(String uri)static @NotNull QNameuriToQName(String uri, String defaultNamespace)static @NotNull QNameUtil.QNameInfouriToQNameInfo(@NotNull String uri, boolean allowUnqualified)
-
-
-
Field Detail
-
LOGGER
public static final Trace LOGGER
-
DEFAULT_QNAME_URI_SEPARATOR_CHAR
public static final char DEFAULT_QNAME_URI_SEPARATOR_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
qNameToUri
public static String qNameToUri(QName qname, boolean unqualifiedStartsWithHash, char separatorChar)
-
noNamespace
public static boolean noNamespace(@NotNull @NotNull QName name)
-
hasNamespace
public static boolean hasNamespace(@NotNull @NotNull QName name)
-
getByQName
public static <V> V getByQName(@NotNull @NotNull Map<QName,V> map, @NotNull @NotNull QName key)Finds value in the map by QName key usingmatch(QName, QName). Fails if multiple matches are found. Returnsnullif no match is found.
-
uriToQName
@NotNull public static @NotNull QName uriToQName(@NotNull @NotNull String uri, boolean allowUnqualified)
-
uriToQNameInfo
@NotNull public static @NotNull QNameUtil.QNameInfo uriToQNameInfo(@NotNull @NotNull String uri, boolean allowUnqualified)
-
match
public static boolean match(QName a, QName b)
Matching with considering wildcard namespace (null).
-
unorderedCollectionMatch
public static boolean unorderedCollectionMatch(Collection<QName> a, Collection<QName> b)
-
matchWithUri
public static boolean matchWithUri(QName qname, String uri)
Matches QName with a URI representation. The URL may in fact be just the local part.
-
resolveNs
public static QName resolveNs(QName a, Collection<QName> col)
-
matchAny
public static boolean matchAny(QName nameToFind, Collection<? extends QName> names)
-
createCollection
public static Collection<QName> createCollection(QName... qnames)
-
isUnqualified
public static boolean isUnqualified(QName name)
-
isQualified
public static boolean isQualified(QName name)
-
isUnqualified
public static boolean isUnqualified(String uri)
-
isTolerateUndeclaredPrefixes
public static boolean isTolerateUndeclaredPrefixes()
-
setTolerateUndeclaredPrefixes
public static void setTolerateUndeclaredPrefixes(boolean value)
-
setTemporarilyTolerateUndeclaredPrefixes
public static void setTemporarilyTolerateUndeclaredPrefixes(Boolean value)
-
reportUndeclaredNamespacePrefix
public static void reportUndeclaredNamespacePrefix(String prefix, String context)
-
isPrefixUndeclared
public static boolean isPrefixUndeclared(String namespacePrefix)
-
isUri
public static boolean isUri(String string)
-
contains
public static boolean contains(Collection<? extends QName> col, QName qname)
-
remove
public static boolean remove(Collection<? extends QName> col, QName qname)
-
-