When I want to create some small bit of xml the builder is great but having to catch exceptions is horrible.
To make everyone's code cleaner you could wrap the ParserConfigurationException with a new ParserConfigurationRuntimeException and ditto for FactoryConfigurationError wrapped by FactoryConfigurationRuntimeException. Then XmlBuilder.create could throw only RuntimeExceptions and those that wanted the detailed catch behaviour could catch them. Forcing the handling of checked exceptions in a library aiming for code brevity with chaining is a shame in my opinion.
When I want to create some small bit of xml the builder is great but having to catch exceptions is horrible.
To make everyone's code cleaner you could wrap the
ParserConfigurationExceptionwith a newParserConfigurationRuntimeExceptionand ditto forFactoryConfigurationErrorwrapped byFactoryConfigurationRuntimeException. ThenXmlBuilder.createcould throw onlyRuntimeExceptions and those that wanted the detailed catch behaviour could catch them. Forcing the handling of checked exceptions in a library aiming for code brevity with chaining is a shame in my opinion.