/** * Int property accessor method to hide the configuration implementation. * * @param key property key * @param defaultValue The default value. * @return value */ public int getInt(String key, int defaultValue) { return configuration.getInt(key, defaultValue); }
/** * Get a string associated with the given configuration key. * * @param key The configuration key. * @return The associated string. * @throws ClassCastException is thrown if the key maps to an * object that is not a String. */ public String getString(String key) { return getString(key, null); }
/** * @param argStr * @param vars * @return Substituted String. */ public static StringBuffer stringSubstitution( String argStr, Hashtable vars ) { return stringSubstitution( argStr, (Map) vars ); }
/** * Call the wrapped pool. If none are available, it will create a new * temporary one. * @return A parser Object. */ public Parser get() { return (Parser) pool.get(); }
/** * Create a new RuntimeException, setting the cause if possible. * @param message * @param cause * @return A runtime exception object. */ public static RuntimeException createRuntimeException( String message, Throwable cause) { return (RuntimeException) createWithCause( RuntimeException.class, message, cause); }
private void execute0() throws IOException, MojoExecutionException { velocity = new RuntimeInstance(); final ExtProperties p = new ExtProperties(); velocity.setConfiguration(p);
/** * @param wrapped A throwable object that caused the Exception. * @since 1.5 */ public VelocityException(final Throwable wrapped) { super(); this.wrapped = wrapped; ExceptionUtils.setCause(this, wrapped); }
/** * Load the properties from the given input stream. * * @param input the InputStream to load from * @throws IOException if an IO error occurs */ public void load(InputStream input) throws IOException { load(input, null); }
/** * Set a property, this will replace any previously * set values. Set values is implicitly a call * to clearProperty(key), addProperty(key,value). * * @param key the key to set * @param value the value to set */ public void setProperty(String key, Object value) { clearProperty(key); addProperty(key, value); }
/** * Return a string that tells the current location of this node. */ protected String getLocation(InternalContextAdapter context) { return StringUtils.formatFileString(this); }
/** * Boolean property accessor method to hide the configuration implementation. * * @param key property key * @param def The default value if property not found. * @return value of key or default value */ public boolean getBoolean(String key, boolean def) { return configuration.getBoolean(key, def); }
/** * Get a Vector of strings associated with the given configuration * key. * * @param key The configuration key. * @return The associated Vector. * @throws ClassCastException is thrown if the key maps to an * object that is not a Vector. */ public Vector getVector(String key) { return getVector(key, null); }
/** * Interpolate key names to handle ${key} stuff * * @param base string to interpolate * @return returns the key name with the ${key} substituted */ protected String interpolate(String base) { // COPIED from [configuration] 2003-12-29 return (interpolateHelper(base, null)); }
/** * Clear the values pertaining to a particular * property. * * @param key of property to clear */ public void clearProperty(String key) { if (overridingProperties != null) { overridingProperties.clearProperty(key); } }
public static StringBuffer stringSubstitution( String argStr, Hashtable vars ) { return stringSubstitution( argStr, (Map) vars ); }
/** * @param exceptionMessage The message to register. * @param wrapped A throwable object that caused the Exception. * @since 1.5 */ public VelocityException(final String exceptionMessage, final Throwable wrapped) { super(exceptionMessage); this.wrapped = wrapped; ExceptionUtils.setCause(this, wrapped); }
/** * Int property accessor method to hide the configuration implementation. * * @param key Property key * @return value */ public int getInt(String key) { return configuration.getInt(key); }
/** * @param argStr * @param vars * @return Substituted String. */ public static StringBuffer stringSubstitution( String argStr, Hashtable vars ) { return stringSubstitution( argStr, (Map) vars ); }
/** * @param wrapped A throwable object that caused the Exception. * @since 1.5 */ public VelocityException(final Throwable wrapped) { super(); this.wrapped = wrapped; ExceptionUtils.setCause(this, wrapped); }