Class ResolverLookup
java.lang.Object
io.github.projectunified.craftcommand.processor.ResolverLookup
Compile-time element lookups for resolver methods, suggest methods, and fields.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutableElementfindMethod(TypeElement typeElement, String name) Find a no-arg/instance method by name on the given type element.static ExecutableElementfindSuggestMethod(TypeElement typeElement, String name) Find a suggest method by name and validate its signature.static booleanisField(TypeElement typeElement, String name) Checks if a type element declares a field with the given name.
-
Method Details
-
findMethod
Find a no-arg/instance method by name on the given type element. Searches the current class and all parent classes.- Parameters:
typeElement- the type element to searchname- the method name- Returns:
- the matching ExecutableElement, or null if not found
-
findSuggestMethod
Find a suggest method by name and validate its signature.Valid signatures (where S is a sender type):
Collection<String> m()Collection<String> m(String[] current)Collection<String> m(String[] current, String[] context)Collection<String> m(S sender, String[] current)Collection<String> m(S sender, String[] current, String[] context)
- Parameters:
typeElement- the type element to searchname- the method name- Returns:
- the matching method, or
nullif not found or invalid signature
-
isField
Checks if a type element declares a field with the given name.- Parameters:
typeElement- the type elementname- the field name- Returns:
- true if the type element declares a field with the given name.
-