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.PrefixedNamestatic 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 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 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 booleanisUriQName(@NotNull String maybeUri)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 booleanmatches(QName qname, Node node)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 QNameUtil.PrefixedNameparsePrefixedName(String name)static StringprettyPrint(QName... qnames)static QNameUtil.QNameInfoqnameToQnameInfo(QName name)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.
-
parsePrefixedName
public static QNameUtil.PrefixedName parsePrefixedName(String name)
-
qnameToQnameInfo
public static QNameUtil.QNameInfo qnameToQnameInfo(QName name)
-
uriToQName
@NotNull public static @NotNull QName uriToQName(@NotNull @NotNull String uri, boolean allowUnqualified)
-
isUriQName
public static boolean isUriQName(@NotNull @NotNull String maybeUri)
-
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)
-
-