
public abstract class AbstractPropertyConnector extends AbstractConnector
Connectors whiche are Property-related.
Only #getProperty(String, String) must be implemented.
Example implementations are PropertyFileConnector or SystemPropertyConnector.
| Constructor and Description |
|---|
AbstractPropertyConnector() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getContent(String key)
return a byte[]-Value for the given key.
|
Object |
getObject(String key)
return a Object-Value for the given key.
|
protected abstract String |
getProperty(String key,
String defaultValue)
Very similar to
System.getProperty except that the SecurityException is hidden. |
String |
getString(String key)
return a String-Value for the given key.
|
addConnector, getConnectors, getContentResolver, getName, getObjectResolver, init, setContentResolver, setName, setObjectResolverpublic byte[] getContent(String key)
The concrete implementation can use the ContentResolver if required
key - the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"public Object getObject(String key)
The concrete implementation can use the ObjectResolver if required
key - the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"public String getString(String key)
key - the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"protected abstract String getProperty(String key, String defaultValue)
System.getProperty except that the SecurityException is hidden.key - The key to search for.defaultValue - The default value to return.Copyright © 2008–2014. All rights reserved.