Class JavaUtils


  • public class JavaUtils
    extends JavaUtils
    Common Java Utilites
    • Method Detail

      • getPackagesFromNamespace

        public static List getPackagesFromNamespace​(String namespace)
        Parameters:
        namespace -
        Returns:
        List of String containing 1 or 2 packages
      • getPackageFromNamespace

        public static String getPackageFromNamespace​(String namespace)
        Namespace 2 Package algorithm as defined by the JAXB Specification
        Parameters:
        Namespace -
        Returns:
        String representing Namespace
        See Also:
        getPackagesFromNamespace(java.lang.String)
      • getPackageFromNamespace

        public static String getPackageFromNamespace​(String namespace,
                                                     boolean appendUnderscoreToKeyword)
        Parameters:
        Namespace -
        apend - underscore to keyword
        Returns:
        String representing Namespace
      • stackToString

        public static String stackToString()
        Get a string containing the stack of the current location
        Returns:
        String
      • stackToString

        public static String stackToString​(Throwable e)
        Get a string containing the stack of the specified exception
        Parameters:
        e -
        Returns:
      • getCheckedException

        public static Class getCheckedException​(Throwable throwable,
                                                Method method)
        Get checked exception
        Parameters:
        throwable - Throwable
        method - Method
        Returns:
        Class of the checked exception or null
      • createURI

        public static URI createURI​(String pathString)
        Convert a String to a URI, handling special characters in the String such as spaces.
        Parameters:
        pathString - The String to be converted to a URI
        Returns:
        a URI or null if the String can't be converted.