Search in sources :

Example 1 with MethodInvocation

use of io.smallrye.graphql.client.impl.typesafe.reflection.MethodInvocation in project smallrye-graphql by smallrye.

the class HeaderBuilder method resolveHeaderMethod.

private HeaderDescriptor resolveHeaderMethod(Header header) {
    TypeInfo declaringType = method.getDeclaringType();
    MethodInvocation method = new MethodResolver(declaringType, header.method()).resolve();
    if (!method.isStatic())
        throw new RuntimeException("referenced header method '" + header.method() + "'" + " in " + declaringType.getTypeName() + " is not static");
    String value = callMethod(method);
    return new HeaderDescriptor(value, header.name(), toHeaderName(method));
}
Also used : MethodResolver(io.smallrye.graphql.client.impl.typesafe.reflection.MethodResolver) MethodInvocation(io.smallrye.graphql.client.impl.typesafe.reflection.MethodInvocation) TypeInfo(io.smallrye.graphql.client.impl.typesafe.reflection.TypeInfo)

Aggregations

MethodInvocation (io.smallrye.graphql.client.impl.typesafe.reflection.MethodInvocation)1 MethodResolver (io.smallrye.graphql.client.impl.typesafe.reflection.MethodResolver)1 TypeInfo (io.smallrye.graphql.client.impl.typesafe.reflection.TypeInfo)1