FileDocCategorySizeDatePackage
PropertiesStringSource.javaAPI DocGlassfish v2 API3249Fri May 04 22:31:06 BST 2007com.sun.appserv.management.util.misc

PropertiesStringSource

public class PropertiesStringSource extends StringSourceBase implements StringSource
An abstraction for getting a String, given an id string.

Fields Summary
final Properties
mProperties
public static final String
STRINGS_NAME
Constructors Summary
public PropertiesStringSource(Properties props, StringSource delegate)

		super( delegate );
		assert( props != null );
		mProperties	= props;
	
public PropertiesStringSource(File propsFile, StringSource delegate)

		this( propsFromFile( propsFile ), delegate );
	
Methods Summary
public java.lang.StringgetString(java.lang.String id, java.lang.String defaultValue)

		final String	result	= mProperties.getProperty( id, defaultValue );
		return( result );
	
private static java.util.PropertiespropsFromFile(java.io.File propsFile)

		final Properties props	= new Properties();
		props.load( new FileInputStream( propsFile ) );
		return( props );