package .wrapper; import ; /** * Generated wrapper for class: */ public class Wrapper { // keep a reference to the wrapped pojo private pojo = null; // this is private so that we can force the use of the .wrap(pojo) method private Wrapper( toWrap) { this.pojo = toWrap; } // wrap the given pojo if it is not null public static Wrapper wrap( toWrap) { if(toWrap != null) return new Wrapper(toWrap); return null; } /** * pojo method tagged with @roller.wrapPojoMethod type="pojo" * * This method returns another pojo so we need to wrap the returned pojo. */ .Wrapper () { return .Wrapper.wrap(this.pojo.()); } /** * pojo method tagged with @roller.wrapPojoMethod type="pojo-collection" * * This method returns a collection of pojos so we need to wrap * each pojo that is part of the collection. */ java.util.List () { initialCollection = this.pojo.(); // iterate through and wrap // we force the use of an ArrayList because it should be good enough to cover // for any Collection type we encounter. java.util.ArrayList wrappedCollection = new java.util.ArrayList(initialCollection.size()); java.util.Iterator it = initialCollection.iterator(); int i = 0; while(it.hasNext()) { wrappedCollection.add(i, .Wrapper.wrap(() it.next())); i++; } return wrappedCollection; } /** * pojo method tagged with @roller.wrapPojoMethod type="simple" * * Simply returns the same value that the pojo would have returned. */ () { return this.pojo.(); } /** * this is a special method to access the original pojo * we don't really want to do this, but it's necessary * because some parts of the rendering process still need the * orginal pojo object */ public getPojo() { return this.pojo; } }