Class Utils


  • @Supported
    public class Utils
    extends Object
    This class contains utility methods.
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • StringToBoolean

        @Supported
        public static Boolean StringToBoolean​(String str)
                                       throws Exception
        Converts a value of XML boolean type to Boolean object.
        Parameters:
        str - a value of XML boolean type
        Returns:
        a Boolean object
        Throws:
        Exception - if there is a syntax error
      • BooleanToString

        @Supported
        public static String BooleanToString​(Boolean bool)
        Converts a Boolean object to a String representing XML boolean.
        Parameters:
        bool - a Boolean object.
        Returns:
        a String representing the boolean value.
      • convertStringToQName

        @Supported
        public static QName convertStringToQName​(String str,
                                                 Element element)
        Converts a string value to a QName. The prefix of the string value is resolved to a namespace relative to the element.
        Parameters:
        str - the String to be converted.
        element - the Element object.
        Returns:
        the QName Object.
      • getNamespaceForPrefix

        public static String getNamespaceForPrefix​(String prefix,
                                                   Element e)
        Gets the XML namespace URI that is mapped to the specified prefix, in the context of the DOM element e
        Parameters:
        prefix - The namespace prefix to map
        e - The DOM element in which to calculate the prefix binding
        Returns:
        The XML namespace URI mapped to prefix in the context of e
      • getString

        @Supported
        public static String getString​(String key,
                                       Object[] params)
        Gets localized string from resource bundle.
        Parameters:
        key - a key to a resource bundle
        params - parameters to MessageFormat
        Returns:
        a localized string.