Class JavaParserUtil


  • public class JavaParserUtil
    extends Object
    The JavaParserUtil class provides helper functions for generating parsed inputs
    • Constructor Detail

      • JavaParserUtil

        public JavaParserUtil()
    • Method Detail

      • getFirstJavaClass

        public static com.thoughtworks.qdox.model.JavaClass getFirstJavaClass​(Reader... reader)
        Returns the first JavaClass parsed by the given Reader, all upcoming parsed java files will be added to the class library
        Parameters:
        reader - Readers which contents should be parsed
        Returns:
        the parsed JavaClass
      • getFirstJavaClass

        public static com.thoughtworks.qdox.model.JavaClass getFirstJavaClass​(ClassLoader classLoader,
                                                                              Reader... reader)
        Returns the first JavaClass parsed by the given Reader, all upcoming parsed java files will be added to the class library. By passing a ClassLoader, you can take impact on the class name resolving
        Parameters:
        classLoader - which should be used for class name resolving
        reader - Readers which contents should be parsed
        Returns:
        the parsed JavaClass
      • resolveToSimpleType

        public static String resolveToSimpleType​(String canonicalType)
        Converts the String representation of a canonical type into a String which represents the simple type. E.g.:
        • java.lang.String is converted into String
        • java.util.List<java.lang.String> is converted into List<String>
        Parameters:
        canonicalType - the String representation of the canonical type to be resolved
        Returns:
        the resolved simple type as String representation.