If you want to detect it at compile time, the constructor must be non-public. The private one is probably too strict (it makes the code analysis tools suggest that it will never be called and may even trigger warnings in some IDEs), I would say that it is best to use the default (without the modifier protected by the package). In cases where you want to allow subclasses in other packages (but this is not possible without allowing the constructor to be called directly from this subclass), you can protect it. Be sure to comment the constructor accordingly, so anyone who reads the code understands why the constructor is like this.
Spring will invoke this non-public constructor without any problems (since Spring 1.1, SPR-174 ).
, - , Spring ( ) , .
/ ( Spring), . , , , , Spring, .
, , , .
, ( , Spring), , , factory ( , createManuallyInitializedInstance - ).
: - , . , ( , ), . : , .