1 52 53 package freemarker.testcase.models; 54 55 import freemarker.template.*; 56 57 62 public class MultiModel5 implements TemplateSequenceModel, TemplateHashModel { 63 64 private LegacyList m_cList = new LegacyList(); 65 66 67 public MultiModel5() { 68 m_cList.add( new SimpleScalar( "Dummy to make list non-empty" )); 69 } 70 71 74 public TemplateModel get(int i) throws TemplateModelException { 75 return m_cList.get( i ); 76 } 77 78 81 public boolean isEmpty() { 82 return false; 83 } 84 85 public int size() { 86 return m_cList.size(); 87 } 88 89 97 public TemplateModel get(String key) { 98 if( key.equals( "empty" )) { 99 return new SimpleScalar( "Dummy hash value, for test purposes." ); 100 } else { 101 return null; 102 } 103 } 104 105 } 106 | Popular Tags |