Skip to content

Extending Cinch

Ari Gesher edited this page Dec 13, 2011 · 2 revisions

Disclaimer: Palantir Technologies is not affiliated with, endorsed or sponsored by Palantir.net, Inc. Palantir.net's website is http://palantir.net

Palantir Logo

Extending the Cinch framework to understand new kinds of bindings can be accomplished in four easy steps. We've created the com.palantir.ptoss.cinch.example.extension package to illustrate by example. However, you can think of the process as having four steps:

  1. Create a new type of binding. This is simply an annotation that has all the necessary parameters. See LoggedModel.java.
  2. Implement a BindableWiring class that knows how to wire up your particular annotation. Again, see LoggedModel.java as an example.
  3. Assemble the list of standard bindings plus your extensions. See ExtendedBindings.java as an example.
  4. Put it all together, making sure to use the extended bindings. See ExtendedExample.java for a full example.
Clone this wiki locally