Class EnclosedElementsQuery<C,N>
java.lang.Object
io.micronaut.inject.ast.utils.EnclosedElementsQuery<C,N>
- Type Parameters:
C- The class native element typeN- The native element type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanexcludeClass(C classNode) Checks if the class needs to be excluded.protected NgetCacheKey(N element) Get the cache key.protected abstract StringgetElementName(N element) Gets the element name.getEnclosedElements(C classNode, ElementQuery.Result<?> result) Extracts the enclosed elements of the class.getEnclosedElements(C classNode, ElementQuery.Result<?> result, boolean includeAbstract) Extracts the enclosed elements of the class.getEnclosedElements(ClassElement classElement, ElementQuery<T> query) Return the elements that match the given query.getExcludedNativeElements(ElementQuery.Result<?> result) Provides a collection of the native elements to exclude.protected abstract Collection<C> getInterfaces(C classNode) Extracts the interfaces of the class.protected CgetNativeClassType(ClassElement classElement) Get native class element.protected NgetNativeType(Element element) Get native element.protected abstract @Nullable CgetSuperClass(C classNode) Extracts the super class.protected abstract booleanhasAnnotation(N element, Class<? extends Annotation> annotation) protected abstract booleanisAbstractClass(C classNode) Is abstract class.protected abstract booleanisInterface(C classNode) Is interface.protected abstract ElementtoAstElement(N nativeType, Class<?> elementType) Converts the native element to the AST element.
-
Constructor Details
-
EnclosedElementsQuery
public EnclosedElementsQuery()
-
-
Method Details
-
getNativeClassType
Get native class element.- Parameters:
classElement- The class element- Returns:
- The native element
-
getNativeType
-
getEnclosedElements
public <T extends Element> List<T> getEnclosedElements(ClassElement classElement, ElementQuery<T> query) Return the elements that match the given query.- Type Parameters:
T- The element type- Parameters:
classElement- The class elementquery- The query to use.- Returns:
- The fields
-
hasAnnotation
-
getElementName
-
getCacheKey
-
getExcludedNativeElements
Provides a collection of the native elements to exclude.- Parameters:
result- The result- Returns:
- the collection of excluded elements
-
getSuperClass
-
getInterfaces
Extracts the interfaces of the class.- Parameters:
classNode- The class- Returns:
- The interfaces
-
getEnclosedElements
protected abstract List<N> getEnclosedElements(C classNode, ElementQuery.Result<?> result, boolean includeAbstract) Extracts the enclosed elements of the class.- Parameters:
classNode- The classresult- The query resultincludeAbstract- If abstract/non-default elements should be included- Returns:
- The enclosed elements
-
getEnclosedElements
Extracts the enclosed elements of the class.- Parameters:
classNode- The classresult- The query result- Returns:
- The enclosed elements
-
excludeClass
Checks if the class needs to be excluded.- Parameters:
classNode- The class- Returns:
- true if to exclude
-
isAbstractClass
Is abstract class.- Parameters:
classNode- The class node- Returns:
- true if abstract
- Since:
- 4.3.0
-
isInterface
Is interface.- Parameters:
classNode- The class node- Returns:
- true if interface
- Since:
- 4.3.0
-
toAstElement
-