It would be nice to be able to configure the default encoding Jamon uses to generate the .java files, without having to add a <%encoding [encoding]> element at the top of each template.
Currently Jamon uses Charset.defaultCharset() when this element is not present on a template, but changing this plateform default charset for a Java program is not that so simple.
Ideally, I'd like to be able to configure Jamon to use UTF-8 by default, without using any jamon.properties files. Those properties files could still be used to override the default encoding though?
For the framework I'm working on, the best would be to be able to add a "defaultEncoding" to the Maven plugin's configuration (along with "templateSourceDir" and "templateOutputDir") but I understand not everybody uses Maven.
One simple way to add this "default encoding" without being bound to Maven only, would maybe be for Jamon to look for a specific system property (let's say JAMON_DEFAULT_ENCODING) and, if this property exists, to use it as the default. That way it wouldn't be for Maven only, but I'm pretty sure it would be possible to configure Maven to set this system property before running the source generation.
If the system properties files is a idea you find adequate, maybe it could also be use for other default configurations? For example for a default org.jamon.emitMode?
Thanks in advance.
Anonymous
org.jamon.contextType is also something I'd really, really, like to be able to configure from my framework without the need for the developers to create a jamon.properties by themselves...
I think jamonContext will probably be at the center of all view utilities my framework will provide. Without this object, I would have to use static utility methods and I don't want to do that. All the framework is based on Guice and is highly customizable, I don't want to use static methods anywhere.
Being able to change the default name "jamonContext" of that object to something else ("viewUtils" for example) would also be freaking cool!
(see https://sourceforge.net/p/jamon/feature-requests/11/ for more details about this specific request)
Last edit: electrotype 2013-09-09
I wasn't sure when I gave the org.jamon.emitMode example, but after experimenting with it, I would actually also really like to be able to change its default value. I would set it "#H", Strict HTML.
In fact, I'm not sure why Strict HTML is not currently the default! I don't see why someone wouldn't want to also escape the single and double quotes since it is required to not break attribute values.