NVelocity.App.Events |
NVelocity.App.Tools |
Name | Description |
---|---|
FieldMethodizer | This is a small utility class allow easy access to static fields in a class, such as string constants. Velocity will not introspect for class fields (and won't in the future :), but writing setter/getter methods to do this really is a pain, so use this if you really have to access fields. The idea it so enable access to the fields just like you would in Java. For example, in Java, you would access a static field like and that is the same thing we are trying to allow here.MyClass.STRING_CONSTANT So to use in your Java code, do something like this : and then in your template, you can access any of your static fields in this way :context.put("runtime", new FieldMethodizer( "NVelocity.Runtime.Runtime" )); $runtime.RUNTIME_LOG_WARN_STACKTRACE Right now, this class only methodizes |
VelocityEngine | This class provides a separate new-able instance of the Velocity template engine. The alternative model for use is using the Velocity class which employs the singleton model. Please ensure that you call one of the init() variants. This is critical for proper behavior. Coming soon : Velocity will call the parameter-less init() at the first use of this class if the init() wasn't explicitly called. While this will ensure that Velocity functions, it almost certainly won't function in the way you intend, so please make sure to call init(). |