1 package org.apache.velocity.runtime; 2 3 18 19 import java.io.Reader ; 20 21 import java.util.Properties ; 22 23 import org.apache.velocity.Template; 24 25 import org.apache.velocity.runtime.parser.ParseException; 26 import org.apache.velocity.runtime.parser.node.SimpleNode; 27 28 import org.apache.velocity.runtime.directive.Directive; 29 import org.apache.velocity.runtime.resource.ContentResource; 30 31 import org.apache.velocity.util.introspection.Introspector; 32 import org.apache.velocity.util.introspection.Uberspect; 33 34 import org.apache.velocity.exception.ResourceNotFoundException; 35 import org.apache.velocity.exception.ParseErrorException; 36 37 import org.apache.commons.collections.ExtendedProperties; 38 39 40 50 public interface RuntimeServices extends RuntimeLogger 51 { 52 53 67 public void init() throws Exception ; 68 69 76 public void setProperty(String key, Object value); 77 78 88 public void setConfiguration( ExtendedProperties configuration); 89 90 109 public void addProperty(String key, Object value); 110 111 117 public void clearProperty(String key); 118 119 126 public Object getProperty( String key ); 127 128 134 public void init(Properties p) throws Exception ; 135 136 142 public void init(String configurationFile) throws Exception ; 143 144 159 public SimpleNode parse( Reader reader, String templateName ) 160 throws ParseException; 161 162 169 public SimpleNode parse( Reader reader, String templateName, boolean dumpNamespace ) 170 throws ParseException; 171 172 186 public Template getTemplate(String name) 187 throws ResourceNotFoundException, ParseErrorException, Exception ; 188 189 201 public Template getTemplate(String name, String encoding) 202 throws ResourceNotFoundException, ParseErrorException, Exception ; 203 204 214 public ContentResource getContent(String name) 215 throws ResourceNotFoundException, ParseErrorException, Exception ; 216 217 227 public ContentResource getContent( String name, String encoding ) 228 throws ResourceNotFoundException, ParseErrorException, Exception ; 229 230 239 public String getLoaderNameForResource( String resourceName ); 240 241 250 public String getString( String key, String defaultValue); 251 252 259 public Directive getVelocimacro( String vmName, String templateName ); 260 261 271 public boolean addVelocimacro( String name, 272 String macro, 273 String argArray[], 274 String sourceTemplate ); 275 276 282 public boolean isVelocimacro( String vmName, String templateName ); 283 284 288 public boolean dumpVMNamespace( String namespace ); 289 290 295 public String getString(String key); 296 297 303 public int getInt( String key ); 304 305 312 public int getInt( String key, int defaultValue ); 313 314 321 public boolean getBoolean( String key, boolean def ); 322 323 329 public ExtendedProperties getConfiguration(); 330 331 336 public Object getApplicationAttribute( Object key ); 337 338 342 public Uberspect getUberspect(); 343 344 348 public Introspector getIntrospector(); 349 } 350 | Popular Tags |