org.stringtemplate.v4.misc
Class AggregateModelAdaptor

java.lang.Object
  extended by org.stringtemplate.v4.misc.MapModelAdaptor
      extended by org.stringtemplate.v4.misc.AggregateModelAdaptor
All Implemented Interfaces:
ModelAdaptor

public class AggregateModelAdaptor
extends MapModelAdaptor

Deal with structs created via ST.add("structname.{prop1, prop2}", ...);


Constructor Summary
AggregateModelAdaptor()
           
 
Method Summary
 Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName)
          Lookup property name in o and return its value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateModelAdaptor

public AggregateModelAdaptor()
Method Detail

getProperty

public Object getProperty(Interpreter interp,
                          ST self,
                          Object o,
                          Object property,
                          String propertyName)
                   throws STNoSuchPropertyException
Description copied from interface: ModelAdaptor
Lookup property name in o and return its value. It's a good idea to cache a Method or Field reflection object to make this fast after the first look up. property is normally a String but doesn't have to be. E.g., if o is Map, property could be any key type. If we need to convert to string, then it's done by ST and passed in here.

Specified by:
getProperty in interface ModelAdaptor
Overrides:
getProperty in class MapModelAdaptor
Throws:
STNoSuchPropertyException


Copyright © 2011. All Rights Reserved.