
| Constructor and Description |
|---|
CachedConnectorWrapper(Connector targetConnector) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnector(Connector connector)
Add a Connector if you needed inside the
Connector.init() Methode. |
void |
clearCachedValue(String key) |
byte[] |
getContent(String key)
return a byte[]-Value for the given key.
|
String |
getName()
Return The name Of this Connector.
|
Object |
getObject(String key)
return a Object-Value for the given key.
|
String |
getString(String key)
return a String-Value for the given key.
|
void |
init()
Will be called after all properties have been set.
|
void |
setContentResolver(ContentResolver contentResolver)
set a ContentResolver as Helper for
Connector.getContent(String). |
void |
setName(String name)
Set the name of the Connector defined in the settings4j.xml configuration:
--------------------------------------
<connector name="PropertyFileConnector" ....
|
void |
setObjectResolver(ObjectResolver objectResolver)
set a ObjectResolver as Helper for
Connector.getObject(String). |
public CachedConnectorWrapper(Connector targetConnector)
targetConnector - The connector to wrap.public byte[] getContent(String key)
The concrete implementation can use the ContentResolver if required
getContent in interface Connectorkey - 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
public void clearCachedValue(String key)
key - the key to clear from all caches.public void addConnector(Connector connector)
Connector.init() Methode.
Example configuration in settings4j.xml:
--------------------------------------
<connector name="PropertyFileConnector" class="org.settings4j.connector.PropertyFileConnector">
<param name="propertyFromContent"
value="${connectors.content['org/settings4j/config/propertyFile.properties']}" />
<contentResolver-ref ref="DefaultContentResolver" />
<connector-ref ref="ClasspathConnector" />
</connector>
--------------------------------------
addConnector in interface Connectorconnector - the Connector to set.public void setContentResolver(ContentResolver contentResolver)
Connector.getContent(String).setContentResolver in interface ConnectorcontentResolver - the ContentResolver to set.public void setObjectResolver(ObjectResolver objectResolver)
Connector.getObject(String).setObjectResolver in interface ConnectorobjectResolver - the ObjectResolver to set.public void init()
public String getName()
Settings4j.set*(..., String connectorName) Methods.public void setName(String name)
--------------------------------------
<connector name="PropertyFileConnector" ....>
....
</connector>
--------------------------------------
Copyright © 2008–2014. All rights reserved.