Package de.willuhn.jameica.services
Class VelocityService
java.lang.Object
de.willuhn.jameica.services.VelocityService
- All Implemented Interfaces:
de.willuhn.boot.Bootable
Resource-Loader von Velocity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass[]
depends()
org.apache.velocity.app.VelocityEngine
Liefert die Velocity-Engine fuer das angegebene Plugin.void
init
(de.willuhn.boot.BootLoader loader, de.willuhn.boot.Bootable caller) Interpretiert das Velocity-Template im String "source" und nimmt alle Ersetzungen gemaess dem Context.void
shutdown()
-
Constructor Details
-
VelocityService
public VelocityService()
-
-
Method Details
-
depends
- Specified by:
depends
in interfacede.willuhn.boot.Bootable
- See Also:
-
init
public void init(de.willuhn.boot.BootLoader loader, de.willuhn.boot.Bootable caller) throws de.willuhn.boot.SkipServiceException - Specified by:
init
in interfacede.willuhn.boot.Bootable
- Throws:
de.willuhn.boot.SkipServiceException
- See Also:
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfacede.willuhn.boot.Bootable
- See Also:
-
getEngine
Liefert die Velocity-Engine fuer das angegebene Plugin.- Parameters:
plugin
- Name des Plugins oder Name der Plugin-Klasse.- Returns:
- die Velocity-Engine oder die Default-Velocity-Engine von Jameica selbst wenn keine Plugin-spezifische gefunden wurde.
-
merge
Interpretiert das Velocity-Template im String "source" und nimmt alle Ersetzungen gemaess dem Context. Das ist eine bequeme "Convenience"-Funktion, um mal schnell was in einem String zu ersetzen, ohne erst manuell eine ganze VelocityEngine samt Readern und Writern programmieren zu muessen.- Parameters:
source
- Der Text mit den Velocity-Platzhaltern.context
- Map mit den Velocity-Parametern.- Returns:
- der verarbeitete Text.
- Throws:
IOException
-