public final class DelegateMethodDescription
extends java.lang.Object
We use method descriptions to refer to abstract methods defined in com.facebook.litho.Component, so that we can define implementations that delegate to client-declared methods with annotated props.
Modifier and Type | Class and Description |
---|---|
static class |
DelegateMethodDescription.Builder |
static class |
DelegateMethodDescription.InterStagePropsTarget |
static class |
DelegateMethodDescription.OptionalParameterType
Defines possible param types that can be used in delegate methods.
|
Modifier and Type | Field and Description |
---|---|
javax.lang.model.element.Modifier |
accessType |
ImmutableList<AnnotationSpec> |
annotations |
boolean |
createsLegacyState |
ImmutableList<TypeName> |
exceptions |
ImmutableList<MethodSpec> |
extraMethods |
ImmutableList<java.lang.Class<? extends java.lang.annotation.Annotation>> |
interStageInputAnnotations |
ImmutableList<LifecycleMethodArgumentType> |
lifecycleMethodArgumentTypes |
DelegateMethodDescription.InterStagePropsTarget |
mInterStagePropsTarget |
java.lang.String |
name |
ImmutableList<MethodParamModel> |
optionalParameters |
ImmutableList<DelegateMethodDescription.OptionalParameterType> |
optionalParameterTypes |
TypeName |
returnType |
Modifier and Type | Method and Description |
---|---|
ImmutableList<TypeName> |
allowedDelegateMethodArguments() |
static DelegateMethodDescription.Builder |
fromDelegateMethodDescription(DelegateMethodDescription methodDescription) |
static boolean |
isAllowedTypeAndConsume(MethodParamModel arg,
java.util.Queue<TypeName> types)
This utility searches for the first lifecycle argument used by the delegate method, and
consumes it.
|
static boolean |
isArgumentTypeAllowed(MethodParamModel arg,
ImmutableList<TypeName> types)
Checks if any allowed argument type matches the delegate method param.
|
static boolean |
isArgumentTypeAllowed(MethodParamModel arg,
TypeName expected)
Checks if the argument type matches the delegate method param.
|
static DelegateMethodDescription.Builder |
newBuilder() |
public final ImmutableList<AnnotationSpec> annotations
public final javax.lang.model.element.Modifier accessType
public final TypeName returnType
public final java.lang.String name
public final ImmutableList<LifecycleMethodArgumentType> lifecycleMethodArgumentTypes
public final ImmutableList<MethodParamModel> optionalParameters
public final ImmutableList<DelegateMethodDescription.OptionalParameterType> optionalParameterTypes
public final ImmutableList<java.lang.Class<? extends java.lang.annotation.Annotation>> interStageInputAnnotations
public final DelegateMethodDescription.InterStagePropsTarget mInterStagePropsTarget
public final ImmutableList<MethodSpec> extraMethods
public final ImmutableList<TypeName> exceptions
public final boolean createsLegacyState
public ImmutableList<TypeName> allowedDelegateMethodArguments()
public static DelegateMethodDescription.Builder newBuilder()
public static DelegateMethodDescription.Builder fromDelegateMethodDescription(DelegateMethodDescription methodDescription)
public static boolean isAllowedTypeAndConsume(MethodParamModel arg, java.util.Queue<TypeName> types)
public static boolean isArgumentTypeAllowed(MethodParamModel arg, ImmutableList<TypeName> types)
public static boolean isArgumentTypeAllowed(MethodParamModel arg, TypeName expected)