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
  • Field Details

    • LOGGER

      public static final Trace LOGGER
    • DEFAULT_QNAME_URI_SEPARATOR_CHAR

      public static final char DEFAULT_QNAME_URI_SEPARATOR_CHAR
      See Also:
  • Constructor Details

    • QNameUtil

      public QNameUtil()
  • Method Details

    • qNameToUri

      public static String qNameToUri(QName qname)
    • qNameToUri

      public static String qNameToUri(QName qname, boolean unqualifiedStartsWithHash)
    • qNameToUri

      public static String qNameToUri(QName qname, boolean unqualifiedStartsWithHash, char separatorChar)
    • uriToQName

      public static QName uriToQName(String uri)
    • noNamespace

      public static boolean noNamespace(@NotNull @NotNull QName name)
    • hasNamespace

      public static boolean hasNamespace(@NotNull @NotNull QName name)
    • unqualify

      public static QName unqualify(QName name)
    • qualifyIfNeeded

      public static QName qualifyIfNeeded(QName name, String defaultNamespace)
    • getByQName

      public static <K extends QName, V> V getByQName(@NotNull @NotNull Map<K,V> map, @NotNull K key)
      Finds value in the map by QName key using match(QName, QName). Fails if multiple matches are found. Returns null if no match is found. !!! EXPECTS THAT THE MAP CONTAINS QUALIFIED NAMES (if querying by qualified key) !!!
    • matchUri

      public static boolean matchUri(String uri1, String uri2)
    • 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)
    • uriToQName

      @NotNull public static @NotNull QName uriToQName(String uri, String defaultNamespace)
    • uriToQNameInfo

      @NotNull public static @NotNull QNameUtil.QNameInfo uriToQNameInfo(@NotNull @NotNull String uri, boolean allowUnqualified)
    • matches

      public static boolean matches(QName qname, Node node)
    • match

      public static boolean match(QName a, QName b)
      Matching with considering wildcard namespace (null).
    • match

      public static boolean match(QName a, QName b, boolean caseInsensitive)
    • 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)
    • nullNamespace

      public static QName nullNamespace(QName qname)
    • 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)
    • markPrefixAsUndeclared

      public static String markPrefixAsUndeclared(String namespacePrefix)
    • isPrefixUndeclared

      public static boolean isPrefixUndeclared(String namespacePrefix)
    • isUri

      public static boolean isUri(String string)
    • getLocalPart

      public static String getLocalPart(QName name)
    • contains

      public static boolean contains(Collection<? extends QName> col, QName qname)
    • contains

      public static boolean contains(QName[] array, QName qname)
    • remove

      public static boolean remove(Collection<? extends QName> col, QName qname)
    • escapeElementName

      public static String escapeElementName(String name)
    • prettyPrint

      public static String prettyPrint(QName... qnames)