Open full view…

How do you write your own @VelocityObject and @VelocityMethod?

Fri, 07 Aug 2015 22:29:57 GMT

Is it going to work automagically if I create classes with above annotation, create a jar and drop in lib folder in TelosysTools folder in eclipse? If not how do i register that class in Telosys Tools?

Telosys Team
Wed, 12 Aug 2015 21:59:52 GMT

Unfortunately no, it's not magic. But you can create your own classes and use them in a template with the "$loader" object (see the doc in Eclipse help) You don't have to use the annotations @VelocityObject, etc Examples : ## create an instance of StringBuilder and put it in the context with #set #set( $strBuilder = $loader.newInstance('java.lang.StringBuilder') ) ## use the instance $strBuilder.append('aa') ## create new instance of a specific class (your own class) #set( $tool = $loader.newInstance('MyTool') )