[stringtemplate-interest] Primitives and Model Adapters

Terence Parr parrt at cs.usfca.edu
Fri Jan 28 10:10:40 PST 2011


On Jan 28, 2011, at 5:59 AM, Collin Fagan wrote:

> I understand, no problem at all. In this case though can we do one of two things?
> 
> 1. Throw an IllegalArgumentException when one tries to register a model adapter on a primitive.  
> 2. Translate any primitive into it's boxed type during registration. ST already seems to treat return values of primitive types like boxed types when the template is run. 

is there a java method to convert int.class to Integer.class already?
Ter


More information about the stringtemplate-interest mailing list