public interface DependencyInjectionHelper
Modifier and Type | Method and Description |
---|---|
com.squareup.javapoet.MethodSpec |
generateConstructor(SpecModel specModel)
Generate the constructor required for Dependency Injection.
|
com.squareup.javapoet.CodeBlock |
generateFactoryMethodsComponentInstance(SpecModel specModel)
Generate the code needed to inject a new instance of the given SpecModel called 'instance'
|
TypeSpecDataHolder |
generateInjectedFields(ImmutableList<InjectPropModel> injectPropParams)
Generate the necessary code to handle the
InjectProp
annotation. |
com.squareup.javapoet.MethodSpec |
generateTestingFieldAccessor(InjectPropModel injectPropModel)
Generate an accessor for each injected field.
|
boolean |
isValidGeneratedComponentAnnotation(com.squareup.javapoet.AnnotationSpec annotation)
Whether a Spec annotation should be moved to the generated Component.
|
List<SpecModelValidationError> |
validate(SpecModel specModel)
Validate that the dependency injection for this spec is correctly defined.
|
List<SpecModelValidationError> validate(SpecModel specModel)
boolean isValidGeneratedComponentAnnotation(com.squareup.javapoet.AnnotationSpec annotation)
com.squareup.javapoet.MethodSpec generateConstructor(SpecModel specModel)
com.squareup.javapoet.CodeBlock generateFactoryMethodsComponentInstance(SpecModel specModel)
TypeSpecDataHolder generateInjectedFields(ImmutableList<InjectPropModel> injectPropParams)
InjectProp
annotation. Field with the same name of the parameter should be returned to be usable.injectPropParams
- com.squareup.javapoet.MethodSpec generateTestingFieldAccessor(InjectPropModel injectPropModel)