@Internal public class ModelUtils extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
ModelUtils(javax.lang.model.util.Elements elementUtils,
javax.lang.model.util.Types typeUtils) |
Modifier and Type | Method and Description |
---|---|
javax.lang.model.element.TypeElement |
classElementFor(javax.lang.model.element.Element element)
Obtains the
TypeElement for an given element. |
javax.lang.model.element.ExecutableElement |
concreteConstructorFor(javax.lang.model.element.TypeElement classElement,
AnnotationUtils annotationUtils)
The constructor inject for the given class element.
|
javax.lang.model.element.ExecutableElement |
defaultConstructorFor(javax.lang.model.element.TypeElement classElement) |
javax.lang.model.element.ExecutableElement |
defaultStaticCreatorFor(javax.lang.model.element.TypeElement classElement,
AnnotationUtils annotationUtils) |
javax.lang.model.util.Types |
getTypeUtils() |
java.util.Optional<javax.lang.model.element.ElementKind> |
resolveKind(javax.lang.model.element.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. |
java.util.Optional<javax.lang.model.element.ElementKind> |
resolveKind(javax.lang.model.element.Element element,
javax.lang.model.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. |
javax.lang.model.element.ExecutableElement |
staticCreatorFor(javax.lang.model.element.TypeElement classElement,
AnnotationUtils annotationUtils)
The static method or Kotlin companion method to execute to
construct the given class element.
|
protected ModelUtils(javax.lang.model.util.Elements elementUtils, javax.lang.model.util.Types typeUtils)
elementUtils
- The Elements
typeUtils
- The Types
public javax.lang.model.util.Types getTypeUtils()
@Nullable public final javax.lang.model.element.TypeElement classElementFor(javax.lang.model.element.Element element)
TypeElement
for an given element.element
- The elementTypeElement
@Nullable public javax.lang.model.element.ExecutableElement concreteConstructorFor(javax.lang.model.element.TypeElement classElement, AnnotationUtils annotationUtils)
classElement
- The class elementannotationUtils
- The annotation utilities@Nullable public javax.lang.model.element.ExecutableElement staticCreatorFor(javax.lang.model.element.TypeElement classElement, AnnotationUtils annotationUtils)
classElement
- The class elementannotationUtils
- The annotation utilitiespublic javax.lang.model.element.ExecutableElement defaultConstructorFor(javax.lang.model.element.TypeElement classElement)
classElement
- The class elementpublic javax.lang.model.element.ExecutableElement defaultStaticCreatorFor(javax.lang.model.element.TypeElement classElement, AnnotationUtils annotationUtils)
classElement
- The class elementannotationUtils
- The annotation utilspublic java.util.Optional<javax.lang.model.element.ElementKind> resolveKind(javax.lang.model.element.Element element, javax.lang.model.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 java.util.Optional<javax.lang.model.element.ElementKind> resolveKind(javax.lang.model.element.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 element