public interface Connector
ClasspathConnector
)ContentResolver
and ObjectResolver
for internal use.Example configuration in settings4j.xml: -------------------------------------- <connector name="ClasspathConnector" class="org.settings4j.connector.ClasspathConnector" > <objectResolver-ref ref="DefaultObjectResolver" /> </connector> --------------------------------------
Modifier and Type | Method and Description |
---|---|
void |
addConnector(Connector connector)
Add a Connector if you needed inside the
init() Methode. |
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
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
getObject(String) . |
String getString(String key)
key
- the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"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"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"void setContentResolver(ContentResolver contentResolver)
getContent(String)
.contentResolver
- the ContentResolver to set.void setObjectResolver(ObjectResolver objectResolver)
getObject(String)
.objectResolver
- the ObjectResolver to set.void addConnector(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> --------------------------------------
connector
- the Connector to set.void init()
String getName()
Settings4j
.set*(..., String connectorName) Methods.void setName(String name)
-------------------------------------- <connector name="PropertyFileConnector" ....> .... </connector> --------------------------------------
name
- the Name of this Connector.Copyright © 2008–2014. All rights reserved.