1 package org.apache.beehive.controls.runtime.generator; 2 3 20 import org.apache.velocity.runtime.RuntimeServices; 21 import org.apache.velocity.runtime.log.LogSystem; 22 23 import com.sun.mirror.apt.Messager; 24 25 30 public class VelocityAptLogSystem implements LogSystem 31 { 32 38 static final String APT_ENV_PROPERTY = VelocityAptLogSystem.class + "." + "environment"; 39 40 44 static final private String MESSAGE_PREFIX = "VELOCITY: "; 45 46 50 static final private boolean _debugging = false; 51 52 public VelocityAptLogSystem(Messager messager) 53 { 54 _messager = messager; 55 } 56 57 public void init(RuntimeServices rs) throws java.lang.Exception 58 { 59 } 60 61 public void logVelocityMessage(int level, java.lang.String message) 62 { 63 if (level == LogSystem.ERROR_ID) 64 _messager.printError(MESSAGE_PREFIX + message); 65 else if (level == LogSystem.WARN_ID) 66 _messager.printWarning(MESSAGE_PREFIX + message); 67 else if (_debugging) 68 _messager.printNotice(MESSAGE_PREFIX + message); 69 } 70 71 Messager _messager; 72 } 73 | Popular Tags |