1 19 20 package org.apache.tools.ant.module.spi; 21 22 import java.io.File ; 23 import java.util.Set ; 24 import org.apache.tools.ant.module.run.LoggerTrampoline; 25 26 41 public final class AntEvent { 42 43 static { 44 LoggerTrampoline.ANT_EVENT_CREATOR = new LoggerTrampoline.Creator() { 45 public AntSession makeAntSession(LoggerTrampoline.AntSessionImpl impl) { 46 throw new AssertionError (); 47 } 48 public AntEvent makeAntEvent(LoggerTrampoline.AntEventImpl impl) { 49 return new AntEvent(impl); 50 } 51 public TaskStructure makeTaskStructure(LoggerTrampoline.TaskStructureImpl impl) { 52 throw new AssertionError (); 53 } 54 }; 55 } 56 57 private final LoggerTrampoline.AntEventImpl impl; 58 private AntEvent(LoggerTrampoline.AntEventImpl impl) { 59 this.impl = impl; 60 } 61 62 65 public static final int LOG_ERR = 0; 66 67 70 public static final int LOG_WARN = 1; 71 72 75 public static final int LOG_INFO = 2; 76 77 80 public static final int LOG_VERBOSE = 3; 81 82 85 public static final int LOG_DEBUG = 4; 86 87 91 public AntSession getSession() { 92 return impl.getSession(); 93 } 94 95 99 public void consume() throws IllegalStateException { 100 impl.consume(); 101 } 102 103 107 public boolean isConsumed() { 108 return impl.isConsumed(); 109 } 110 111 115 public File getScriptLocation() { 116 return impl.getScriptLocation(); 117 } 118 119 124 public int getLine() { 125 return impl.getLine(); 126 } 127 128 133 public String getTargetName() { 134 return impl.getTargetName(); 135 } 136 137 143 public String getTaskName() { 144 return impl.getTaskName(); 145 } 146 147 152 public TaskStructure getTaskStructure() { 153 return impl.getTaskStructure(); 154 } 155 156 161 public String getMessage() { 162 return impl.getMessage(); 163 } 164 165 171 public int getLogLevel() { 172 return impl.getLogLevel(); 173 } 174 175 181 public Throwable getException() { 182 return impl.getException(); 183 } 184 185 190 public String getProperty(String name) { 191 return impl.getProperty(name); 192 } 193 194 198 public Set <String > getPropertyNames() { 199 return impl.getPropertyNames(); 200 } 201 202 209 public String evaluate(String text) { 210 return impl.evaluate(text); 211 } 212 213 @Override 214 public String toString() { 215 return impl.toString(); 216 } 217 218 } 219 | Popular Tags |