/** * String property accessor method to hide the configuration implementation * @param key property key * @return value of key or null */ public static String getString(String key) { return ri.getString( key ); }
/** * String property accessor method to hide the configuration implementation * @param key property key * @return value of key or null * @see RuntimeInstance#getString(String) */ public static String getString(String key) { return ri.getString( key ); }
/** * String property accessor method to hide the configuration implementation * @param key property key * @return value of key or null * @see RuntimeInstance#getString(String) */ public static String getString(String key) { return ri.getString( key ); }
/** * Retrieves and caches the configured default encoding * for better performance. (VELOCITY-606) */ private String getDefaultEncoding() { if (encoding == null) { encoding = getString(INPUT_ENCODING, ENCODING_DEFAULT); } return encoding; }
/** * String property accessor method to hide the configuration implementation * @param key property key * @return value of key or null * @see RuntimeInstance#getString(String) */ public static String getString(String key) { return ri.getString( key ); }
/** * Retrieves and caches the configured default encoding * for better performance. (VELOCITY-606) */ private String getDefaultEncoding() { if (encoding == null) { encoding = getString(INPUT_ENCODING, ENCODING_DEFAULT); } return encoding; }
/** * String property accessor method with default to hide the * configuration implementation. * * @param String key property key * @param String defaultValue default value to return if key not * found in resource manager. * @return String value of key or default */ public static String getString( String key, String defaultValue) { return ri.getString( key, defaultValue ); }
/** * String property accessor method with default to hide the * configuration implementation. * * @param key property key * @param defaultValue default value to return if key not * found in resource manager. * @return value of key or default * @see RuntimeInstance#getString(String, String) */ public static String getString( String key, String defaultValue) { return ri.getString(key, defaultValue); }
/** * String property accessor method with default to hide the * configuration implementation. * * @param key property key * @param defaultValue default value to return if key not * found in resource manager. * @return value of key or default * @see RuntimeInstance#getString(String, String) */ public static String getString( String key, String defaultValue) { return ri.getString( key, defaultValue ); }
/** * String property accessor method with default to hide the * configuration implementation. * * @param key property key * @param defaultValue default value to return if key not * found in resource manager. * @return value of key or default * @see RuntimeInstance#getString(String, String) */ public static String getString( String key, String defaultValue) { return ri.getString( key, defaultValue ); }
/** * Get a logger for the specified child namespace. * If a logger was configured using the runtime.log.instance configuration property, returns this instance. * Otherwise, uses SLF4J LoggerFactory on baseNamespace + childNamespace. * @param childNamespace * @return */ public Logger getLog(String childNamespace) { Logger log = (Logger)getProperty(RuntimeConstants.RUNTIME_LOG_INSTANCE); if (log == null) { String loggerName = getString(RUNTIME_LOG_NAME, DEFAULT_RUNTIME_LOG_NAME) + "." + childNamespace; log = LoggerFactory.getLogger(loggerName); } return log; }
/** * Returns a static content resource from the * resource manager. Uses the current value * if INPUT_ENCODING as the character encoding. * * @param name Name of content resource to get * @return parsed ContentResource object ready for use * @throws ResourceNotFoundException if template not found * from any available source. */ public ContentResource getContent(String name) throws ResourceNotFoundException, ParseErrorException, Exception { /* * the encoding is irrelvant as we don't do any converstion * the bytestream should be dumped to the output stream */ return getContent( name, getString( INPUT_ENCODING, ENCODING_DEFAULT)); }
/** * Returns a <code>Template</code> from the resource manager. * This method assumes that the character encoding of the * template is set by the <code>input.encoding</code> * property. The default is "ISO-8859-1" * * @param name The file name of the desired template. * @return The template. * @throws ResourceNotFoundException if template not found * from any available source. * @throws ParseErrorException if template cannot be parsed due * to syntax (or other) error. * @throws Exception if an error occurs in template initialization */ public Template getTemplate(String name) throws ResourceNotFoundException, ParseErrorException, Exception { return getTemplate( name, getString( INPUT_ENCODING, ENCODING_DEFAULT) ); }
/** * merges a template and puts the rendered stream into the writer * * @param templateName name of template to be used in merge * @param context filled context to be used in merge * @param writer writer to write template into * * @return true if successful, false otherwise. Errors * logged to velocity log. * * @deprecated Use * {@link #mergeTemplate( String templateName, String encoding, * Context context, Writer writer )} */ public boolean mergeTemplate( String templateName, Context context, Writer writer ) throws ResourceNotFoundException, ParseErrorException, MethodInvocationException, Exception { return mergeTemplate( templateName, ri.getString(INPUT_ENCODING,ENCODING_DEFAULT), context, writer ); }
/** * Merges a template and puts the rendered stream into the writer. * The default encoding that Velocity uses to read template files is defined in * the property input.encoding and defaults to ISO-8859-1. * * @param templateName name of template to be used in merge * @param context filled context to be used in merge * @param writer writer to write template into * * @return true if successful, false otherwise. Errors * logged to velocity log. * @throws ResourceNotFoundException * @throws ParseErrorException * @throws MethodInvocationException * @deprecated Use * {@link #mergeTemplate( String templateName, String encoding, * Context context, Writer writer )} */ public boolean mergeTemplate( String templateName, Context context, Writer writer ) throws ResourceNotFoundException, ParseErrorException, MethodInvocationException { return mergeTemplate( templateName, ri.getString(INPUT_ENCODING,ENCODING_DEFAULT), context, writer ); }
/** * Merges a template and puts the rendered stream into the writer. * The default encoding that Velocity uses to read template files is defined in * the property input.encoding and defaults to ISO-8859-1. * * @param templateName name of template to be used in merge * @param context filled context to be used in merge * @param writer writer to write template into * * @return true if successful, false otherwise. Errors * logged to velocity log. * @throws ResourceNotFoundException * @throws ParseErrorException * @throws MethodInvocationException * @throws Exception * @deprecated Use * {@link #mergeTemplate( String templateName, String encoding, * Context context, Writer writer )} */ public boolean mergeTemplate( String templateName, Context context, Writer writer ) throws ResourceNotFoundException, ParseErrorException, MethodInvocationException, Exception { return mergeTemplate( templateName, ri.getString(INPUT_ENCODING,ENCODING_DEFAULT), context, writer ); }
/** * Initialize runtime internal properties */ private void initializeSelfProperties() { /* initialize string interning (defaults to false) */ stringInterning = getBoolean(RUNTIME_STRING_INTERNING, true); /* initialize indentation mode (defaults to 'lines') */ String im = getString(SPACE_GOBBLING, "lines"); try { spaceGobbling = SpaceGobbling.valueOf(im.toUpperCase()); } catch (NoSuchElementException nse) { spaceGobbling = SpaceGobbling.LINES; } }
defaultEncoding = getString(INPUT_ENCODING, ENCODING_DEFAULT);
encoding = ri.getString(INPUT_ENCODING,ENCODING_DEFAULT); br = new BufferedReader( new InputStreamReader( instream, encoding));
encoding = ri.getString(INPUT_ENCODING,ENCODING_DEFAULT); br = new BufferedReader( new InputStreamReader( instream, encoding));