net.forthecrown.grenadier.annotations.compiler.MemberChain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grenadier-annotations Show documentation
Show all versions of grenadier-annotations Show documentation
Annotation-based command support for Grenadier
package net.forthecrown.grenadier.annotations.compiler;
import it.unimi.dsi.fastutil.Pair;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.forthecrown.grenadier.annotations.util.Utils;
import org.jetbrains.annotations.NotNull;
/**
* A chain of method calls/field accesses
*/
interface MemberChain {
/**
* Gets the next member in the chain of member calls
* @return Next member chain, or {@code null}, if this is the last node
*/
MemberChain next();
Object resolve(Object declaringObject) throws ReflectiveOperationException;
default Object resolveSafe(Object declaringObject) {
try {
return resolve(declaringObject);
} catch (ReflectiveOperationException exc) {
Utils.sneakyThrow(exc);
return null;
}
}
default @NotNull Pair
© 2015 - 2025 Weber Informatics LLC | Privacy Policy