Class DefaultVelocityComponent

java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.plexus.velocity.DefaultVelocityComponent
All Implemented Interfaces:
org.apache.velocity.runtime.log.LogChute, org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, VelocityComponent

public class DefaultVelocityComponent extends org.codehaus.plexus.logging.AbstractLogEnabled implements VelocityComponent, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.apache.velocity.runtime.log.LogChute
A simple velocity component implementation.

A typical configuration will look like this:

      
        
          
            resource.loader
            classpath
          
          
            classpath.resource.loader.class
            org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
          
        
      
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.apache.velocity.app.VelocityEngine
     
    private Properties
     
    private org.apache.velocity.runtime.RuntimeServices
     

    Fields inherited from interface org.apache.velocity.runtime.log.LogChute

    DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX

    Fields inherited from interface org.codehaus.plexus.velocity.VelocityComponent

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.velocity.app.VelocityEngine
     
    void
    init(org.apache.velocity.runtime.RuntimeServices runtimeServices)
     
    void
     
    boolean
    isLevelEnabled(int level)
     
    void
    log(int level, String message)
     
    void
    log(int level, String message, Throwable t)
     

    Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled

    enableLogging, getLogger, setupLogger, setupLogger, setupLogger

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • engine

      private org.apache.velocity.app.VelocityEngine engine
    • properties

      private Properties properties
    • runtimeServices

      private org.apache.velocity.runtime.RuntimeServices runtimeServices
  • Constructor Details

    • DefaultVelocityComponent

      public DefaultVelocityComponent()
  • Method Details

    • initialize

      public void initialize() throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
      Specified by:
      initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
      Throws:
      org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
    • getEngine

      public org.apache.velocity.app.VelocityEngine getEngine()
      Specified by:
      getEngine in interface VelocityComponent
    • init

      public void init(org.apache.velocity.runtime.RuntimeServices runtimeServices)
      Specified by:
      init in interface org.apache.velocity.runtime.log.LogChute
    • log

      public void log(int level, String message)
      Specified by:
      log in interface org.apache.velocity.runtime.log.LogChute
    • log

      public void log(int level, String message, Throwable t)
      Specified by:
      log in interface org.apache.velocity.runtime.log.LogChute
    • isLevelEnabled

      public boolean isLevelEnabled(int level)
      Specified by:
      isLevelEnabled in interface org.apache.velocity.runtime.log.LogChute