asciidoctor/asciidoctorj — pull request #252 by robertpanzer (2014-12-24 22:11:42+00:00)
Title: Introduced ConverterProxy to let converter impl only see AsciidoctorJ no...

...de impls

The trick is that not the Converter class is directly registered, but the ConverterProxy class.
When it is instantiated its ObjectAllocator instantiates the correct Converter impl.
This proxy does the (currently incomplete) conversion from JRuby proxy objects to the AsciidoctorJ implementations.
IMO a Java converter should only see these classes, never a JRuby proxy.

The proxy is even able to resolve the problem with the optional arguments for the convert method. If only one or two args are given it forwards the correct defaults to the Java implementation and invokes only one method with three args.