Yes, Spring can invoke private constructors. If it finds a constructor with the right arguments, regardless of visibility, it will use reflection to set its constructor to be accessible.
More Related Contents:
- Can a constructor in Java be private?
- Programmatically configure LogBack appender
- ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException
- Java: accessing private constructor with type parameters
- Calling a non-static method with constructors using objects from a different class [duplicate]
- How to return a custom object from a Spring Data JPA GROUP BY query
- Spring Boot Adding Http Request Interceptors
- POSTing a @OneToMany sub-resource association in Spring Data REST
- Spring boot @ResponseBody doesn’t serialize entity id
- Spring @Autowired and @Qualifier [closed]
- Spring – Redirect after POST (even with validation errors)
- Can a spring boot @RestController be enabled/disabled using properties?
- Gradle – Could not find or load main class
- Deep copy of an object array
- How do I obtain the Jackson ObjectMapper in use by Spring 4.1?
- How to ignore null values using springframework BeanUtils copyProperties?
- Get method arguments using Spring AOP?
- When are connections returned to the connection pool with Spring JPA (Hibernate) Entity Manager?
- Spring JDBC connection pool best practices
- Bind Path variables to a custom model object in spring
- Heroku cannot deploy Java 11 Spring Boot App [duplicate]
- Using Spring 3 autowire in a standalone Java application
- intellij incorrectly saying no beans of type found for autowired repository
- UnsatisfiedDependencyException: Error creating bean with name
- How to use new PasswordEncoder from Spring Security
- Hibernate, spring, JPS & isolation – custom isolation not supported
- How to enable LockModeType.PESSIMISTIC_WRITE when looking up entities with Spring Data JPA?
- Spring JPA native query with Projection gives “ConverterNotFoundException”
- Spring Data + JPA with multiple datasources but only one set of Repositories
- Configuring AspectJ aspects using Spring IoC with JavaConfig?