When using the ObjectFactory class generated by JAXB (from an XSD), I'd like to store it in a field or even constant, so I don't have to pass it around between private methods. As far as I can tell, the ObjectFactory does not have any state, at least for no schema I have used.
Are there cases, e.g. when using specific XSD constructs or JAXB properties, where the ObjectFactory is not stateless?
If there are, is it safe to use a static constant for storing the ObjectFactory or are there thread safety issues?
new
and pass only seem to use local or static variables in their construction. – Semicircle