@ Nullable public ExecutableElement concreteConstructorFor ( TypeElement classElement , AnnotationUtils annotationUtils ) { List < ExecutableElement > constructors = findNonPrivateConstructors ( classElement ) ; if ( constructors . isEmpty ( ) ) { return null ; } if ( constructors . size ( ) == 1 ) { return constructors . get ( 0 ) ; } Optional < ExecutableElement > element = constructors . stream ( ) . filter ( ctor -> { final AnnotationMetadata annotationMetadata = annotationUtils . getAnnotationMetadata ( ctor ) ; return annotationMetadata . hasStereotype ( Inject . class ) || annotationMetadata . hasStereotype ( Creator . class ) ; } ) . findFirst ( ) ; if ( ! element . isPresent ( ) ) { element = constructors . stream ( ) . filter ( ctor -> ctor . getModifiers ( ) . contains ( PUBLIC ) ) . findFirst ( ) ; } return element . orElse ( null ) ; }
The constructor inject for the given class element .