MCPcopy Create free account
hub / github.com/antlr/codebuff / method

Method method

output/java_guava/1.4.17/TypeToken.java:601–632  ·  view source on GitHub ↗

Returns the Invokable for method, which must be a member of T. @since 14.0

(Method method)

Source from the content-addressed store, hash-verified

599
600
601 public final Invokable<T, Object> method(Method method) {
602 checkArgument(this.someRawTypeIsSubclassOf(method.getDeclaringClass()),
603 "%s not declared by %s",
604 method,
605 this);
606 return new Invokable.MethodInvokable<T>(method) {
607 @Override
608 Type getGenericReturnType() {
609 return resolveType(super.getGenericReturnType()).getType();
610 }
611
612 @Override
613 Type[] getGenericParameterTypes() {
614 return resolveInPlace(super.getGenericParameterTypes());
615 }
616
617 @Override
618 Type[] getGenericExceptionTypes() {
619 return resolveInPlace(super.getGenericExceptionTypes());
620 }
621
622 @Override
623 public TypeToken<T> getOwnerType() {
624 return TypeToken.this;
625 }
626
627 @Override
628 public String toString() {
629 return getOwnerType() + "." + super.toString();
630 }
631 };
632 }
633
634 /**
635 * Returns the {@link Invokable} for {@code constructor}, which must be a member of {@code T}.

Callers

nothing calls this directly

Calls 3

checkArgumentMethod · 0.45
getDeclaringClassMethod · 0.45

Tested by

no test coverage detected