Class JavaParserUtil
- java.lang.Object
-
- com.devonfw.cobigen.javaplugin.inputreader.JavaParserUtil
-
public class JavaParserUtil extends Object
TheJavaParserUtilclass provides helper functions for generating parsed inputs
-
-
Constructor Summary
Constructors Constructor Description JavaParserUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.thoughtworks.qdox.model.JavaClassgetFirstJavaClass(Reader... reader)Returns the firstJavaClassparsed by the givenReader, all upcoming parsed java files will be added to the class librarystatic com.thoughtworks.qdox.model.JavaClassgetFirstJavaClass(ClassLoader classLoader, Reader... reader)Returns the firstJavaClassparsed by the givenReader, all upcoming parsed java files will be added to the class library.static StringresolveToSimpleType(String canonicalType)Converts the String representation of a canonical type into a String which represents the simple type.
-
-
-
Method Detail
-
getFirstJavaClass
public static com.thoughtworks.qdox.model.JavaClass getFirstJavaClass(Reader... reader)
Returns the firstJavaClassparsed by the givenReader, 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 firstJavaClassparsed by the givenReader, all upcoming parsed java files will be added to the class library. By passing aClassLoader, you can take impact on the class name resolving- Parameters:
classLoader- which should be used for class name resolvingreader-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.Stringis converted intoStringjava.util.List<java.lang.String>is converted intoList<String>
- Parameters:
canonicalType- the String representation of the canonical type to be resolved- Returns:
- the resolved simple type as String representation.
-
-