public class JavaModelUtils extends Object
| Modifier and Type | Field and Description | 
|---|---|
| static Map<String,String> | NAME_TO_TYPE_MAP | 
| Constructor and Description | 
|---|
| JavaModelUtils() | 
| Modifier and Type | Method and Description | 
|---|---|
| static String | getClassArrayName(TypeElement typeElement)Get the array class name for the given type element. | 
| static String | getClassname(TypedElement type)Return the type reference for a class. | 
| static String | getClassName(TypeElement typeElement)Get the class name for the given type element. | 
| static String | getClassNameWithoutPackage(TypeElement typeElement)Get the class name for the given type element without the package. | 
| static String | getPackageName(TypeElement typeElement) | 
| static org.objectweb.asm.Type | getTypeReference(TypedElement type)Return the type reference for a class. | 
| static boolean | isClass(Element element)Whether the given element is a class. | 
| static boolean | isClassOrInterface(Element element)Whether the given element is a class or interface. | 
| static boolean | isEnum(Element element)Whether the given element is an enum. | 
| static boolean | isInterface(Element element)Whether the given element is an interface. | 
| static boolean | isRecord(Element element)Whether the given element is an interface. | 
| static boolean | isRecordComponent(Element e)Return whether this is a component of a record. | 
| static boolean | isRecordOrRecordComponent(Element e)Return whether this is a record or a component of a record. | 
| static Optional<ElementKind> | resolveKind(Element element)The Java APT throws an internal exception {code com.sun.tools.javac.code.Symbol$CompletionFailure} if a class is missing from the classpath and  Element.getKind()is called. | 
| static Optional<ElementKind> | resolveKind(Element element,
           ElementKind expected)The Java APT throws an internal exception {code com.sun.tools.javac.code.Symbol$CompletionFailure} if a class is missing from the classpath and  Element.getKind()is called. | 
public static Optional<ElementKind> resolveKind(Element element)
Element.getKind() is called. This method
 handles exceptions when calling the getKind() method to avoid this scenario and should be used instead of Element.getKind().element - The elementpublic static Optional<ElementKind> resolveKind(Element element, ElementKind expected)
Element.getKind() is called. This method
 handles exceptions when calling the getKind() method to avoid this scenario and should be used instead of Element.getKind().element - The elementexpected - The expected kindpublic static boolean isInterface(Element element)
element - The elementpublic static boolean isRecord(Element element)
element - The elementpublic static boolean isClass(Element element)
element - The elementpublic static boolean isEnum(Element element)
element - The elementpublic static boolean isClassOrInterface(Element element)
element - The elementpublic static String getClassName(TypeElement typeElement)
NestingKind.typeElement - The type elementpublic static String getClassNameWithoutPackage(TypeElement typeElement)
NestingKind.typeElement - The type elementpublic static String getPackageName(TypeElement typeElement)
public static String getClassArrayName(TypeElement typeElement)
NestingKind.typeElement - The type elementpublic static boolean isRecordOrRecordComponent(Element e)
e - The elementpublic static boolean isRecordComponent(Element e)
e - The elementpublic static org.objectweb.asm.Type getTypeReference(TypedElement type)
type - The typeTypepublic static String getClassname(TypedElement type)
type - The typeType