Write my own renderer classes
If you want a Renderer to perform an operation for which there are no Caplin classes, you can easily write you own functionality and use it in a renderer.
Write a class to the interface
Whether it’s a formatter, parser, styler, handler or control you want to implement all you need to do is write a JavaScript class that conforms to the interface. Let’s call it exampleApp.exampleBladeSet.exampleBlade.WordReversingFormatter
. You would write this class to convert input like "word" into the output "drow". You would also unit-test it (you would unit test it right?).
Include the class name in renderer definitions
All you need to do is reference your new class in the Renderer definitions directly. When the Renderer definitions are loaded by the XML Bundler the JavaScript Bundler scans the XML Bundle and loads your class into the browser. The RendererFactory
instantiates your class when called upon to create a Renderer with your class in it.
<renderer type="exampleApp.exampleBladeSet.exampleBlade.WordReverseRenderer">
...
<downstream>
<transform className="exampleApp.exampleBladeSet.exampleBlade.WordReversingFormatter"/>
</downstream>
...
</renderer>