com.facebook.litho.annotations.MountSpec Java Examples

The following examples show how to use com.facebook.litho.annotations.MountSpec. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LithoPluginUtils.java    From litho with Apache License 2.0 4 votes vote down vote up
static boolean isMountSpec(@Nullable PsiClass psiClass) {
  return psiClass != null && hasAnnotation(psiClass, equals(MountSpec.class.getName()));
}
 
Example #2
Source File: MountSpecModelFactory.java    From litho with Apache License 2.0 4 votes vote down vote up
@Override
public Set<Element> extract(RoundEnvironment roundEnvironment) {
  return (Set<Element>) roundEnvironment.getElementsAnnotatedWith(MountSpec.class);
}
 
Example #3
Source File: MountSpecModelFactory.java    From litho with Apache License 2.0 4 votes vote down vote up
/**
 * Create a {@link MountSpecModel} from the given {@link TypeElement} and an optional {@link
 * DependencyInjectionHelper}.
 */
@Override
public MountSpecModel create(
    Elements elements,
    Types types,
    TypeElement element,
    Messager messager,
    EnumSet<RunMode> runMode,
    @Nullable DependencyInjectionHelper dependencyInjectionHelper,
    @Nullable InterStageStore interStageStore) {
  return new MountSpecModel(
      element.getQualifiedName().toString(),
      element.getAnnotation(MountSpec.class).value(),
      DelegateMethodExtractor.getDelegateMethods(
          element,
          DELEGATE_METHOD_ANNOTATIONS,
          INTER_STAGE_INPUT_ANNOTATIONS,
          ImmutableList.<Class<? extends Annotation>>of(ShouldUpdate.class),
          messager),
      EventMethodExtractor.getOnEventMethods(
          elements, element, INTER_STAGE_INPUT_ANNOTATIONS, messager, runMode),
      TriggerMethodExtractor.getOnTriggerMethods(
          elements, element, INTER_STAGE_INPUT_ANNOTATIONS, messager, runMode),
      WorkingRangesMethodExtractor.getRegisterMethod(
          element, INTER_STAGE_INPUT_ANNOTATIONS, messager),
      WorkingRangesMethodExtractor.getRangesMethods(
          elements, element, INTER_STAGE_INPUT_ANNOTATIONS, messager),
      UpdateStateMethodExtractor.getOnUpdateStateMethods(
          element, INTER_STAGE_INPUT_ANNOTATIONS, messager),
      interStageStore == null
          ? ImmutableList.of()
          : CachedPropNameExtractor.getCachedPropNames(
              interStageStore, element.getQualifiedName()),
      ImmutableList.copyOf(TypeVariablesExtractor.getTypeVariables(element)),
      ImmutableList.copyOf(PropDefaultsExtractor.getPropDefaults(element)),
      EventDeclarationsExtractor.getEventDeclarations(
          elements, element, MountSpec.class, runMode),
      JavadocExtractor.getClassJavadoc(elements, element),
      AnnotationExtractor.extractValidAnnotations(element),
      TagExtractor.extractTagsFromSpecClass(types, element, runMode),
      JavadocExtractor.getPropJavadocs(elements, element),
      element.getAnnotation(MountSpec.class).isPublic(),
      dependencyInjectionHelper,
      element.getAnnotation(MountSpec.class).isPureRender(),
      element.getAnnotation(MountSpec.class).hasChildLithoViews(),
      element.getAnnotation(MountSpec.class).poolSize(),
      element.getAnnotation(MountSpec.class).canPreallocate(),
      getMountType(elements, element, runMode),
      SpecElementTypeDeterminator.determine(element),
      element,
      mMountSpecGenerator,
      FieldsExtractor.extractFields(element),
      BindDynamicValuesMethodExtractor.getOnBindDynamicValuesMethods(element, messager));
}