static ImmutableList<ExecutableElement> orderedConstructorsIn(
      TypeElement element, List<String> reflectAnnotations) {
    List<ExecutableElement> allConstructors =
        ElementFilter.constructorsIn(element.getEnclosedElements());

    List<ExecutableElement> visibleConstructors = new ArrayList<>(allConstructors.size());
    for (ExecutableElement constructor : allConstructors) {
      if (Visibility.ofElement(constructor) != Visibility.PRIVATE) {
        visibleConstructors.add(constructor);
      }
    }
    Collections.sort(visibleConstructors, PARAMETER_COUNT_ORDER.reverse());

    List<ExecutableElement> reflectConstructors = new ArrayList<>();
    if (reflectAnnotations.size() > 0) {
      for (ExecutableElement constructor : allConstructors) {
        if (Visibility.ofElement(constructor) == Visibility.PRIVATE
          && usesAnyAnnotationsFrom(constructor, reflectAnnotations)) {
          reflectConstructors.add(constructor);
        }
      }
      Collections.sort(reflectConstructors, PARAMETER_COUNT_ORDER.reverse());
    }

    return ImmutableList.<ExecutableElement>builder()
        .addAll(visibleConstructors)
        .addAll(reflectConstructors)
        .build();
  }
static ImmutableList < ExecutableElement > orderedConstructorsIn ( TypeElement element , List < String > reflectAnnotations ) { List < ExecutableElement > allConstructors = ElementFilter . constructorsIn ( element . getEnclosedElements ( ) ) ; List < ExecutableElement > visibleConstructors = new ArrayList < > ( allConstructors . size ( ) ) ; for ( ExecutableElement constructor : allConstructors ) { if ( Visibility . ofElement ( constructor ) != Visibility . PRIVATE ) { visibleConstructors . add ( constructor ) ; } } Collections . sort ( visibleConstructors , PARAMETER_COUNT_ORDER . reverse ( ) ) ; List < ExecutableElement > reflectConstructors = new ArrayList < > ( ) ; if ( reflectAnnotations . size ( ) > 0 ) { for ( ExecutableElement constructor : allConstructors ) { if ( Visibility . ofElement ( constructor ) == Visibility . PRIVATE && usesAnyAnnotationsFrom ( constructor , reflectAnnotations ) ) { reflectConstructors . add ( constructor ) ; } } Collections . sort ( reflectConstructors , PARAMETER_COUNT_ORDER . reverse ( ) ) ; } return ImmutableList . < ExecutableElement > builder ( ) . addAll ( visibleConstructors ) . addAll ( reflectConstructors ) . build ( ) ; }
Returns all of the constructors in a {@link TypeElement} that PaperParcel can use.