com.eva.properties.SystemProperties Maven / Gradle / Ivy
/*
* $Id: SystemProperties.java 16 2007-02-10 10:09:34Z max $
*
* Copyright (c) 2006-2007 Maximilian Antoni. All rights reserved.
*
* This software is licensed as described in the file LICENSE.txt, which you
* should have received as part of this distribution. The terms are also
* available at http://www.maxantoni.de/projects/eva-properties/license.txt.
*/
package com.eva.properties;
/**
* delegates getProperty
to the system properties.
*
* @author Max Antoni
* @version $Revision: 16 $
*/
class SystemProperties extends Properties {
/**
* the only instance.
*/
static final SystemProperties INSTANCE = new SystemProperties();
/**
* singleton constructor.
*/
private SystemProperties() {
super(null);
}
/*
* @see com.eva.properties.Properties#getProperty(
* com.eva.properties.Context, java.lang.String)
*/
Object getProperty(Context inContext, String inKey) {
return System.getProperty(inKey);
}
/*
* @see com.eva.properties.Properties#putProperty(
* com.eva.properties.Context, java.lang.String, java.lang.Object)
*/
Object putProperty(Context inContext, String inKey, Object inValue) {
throw new PropertiesException("System properties are read only.");
}
/*
* @see com.eva.properties.Properties#toString(java.lang.StringBuffer,
* java.lang.String)
*/
void write(Writer inoutWriter) {
inoutWriter.append("system");
inoutWriter.appendNewline();
}
/*
* @see com.eva.properties.Properties#copy(com.eva.properties.Properties)
*/
Properties copy(Properties inParent) {
return INSTANCE;
}
}