public interface ObjectResolver
The ObjectResolver is a Helper to resolve byte[] Content to a Java Object.
Example Configuration in settings4j.xml:<connector name="ClasspathConnector" class="org.settings4j.connector.ClasspathConnector"> <objectResolver-ref ref="JavaXMLBeansObjectResolver" /> </connector> <objectResolver name="JavaXMLBeansObjectResolver" class="org.settings4j.objectresolver.JavaXMLBeansObjectResolver" />
You can now store a XMLEncoded (Serialized) Java-Objects into your Classpath.
see JavaXMLBeansObjectResolver
for more details.
Or see SpringConfigObjectResolver
for more details on a Spring Configuration
File to generate an Object. Requires Springframework (tested with 2.5.6)
Modifier and Type | Method and Description |
---|---|
void |
addObjectResolver(ObjectResolver objectResolver)
Some Implementations of a
ObjectResolver are delegating the functionality
to other ObjectResolvers. |
Object |
getObject(String key,
ContentResolver contentResolver)
Reads the byte[] content from the ContentResolver and creates an Object.
|
Object getObject(String key, ContentResolver contentResolver)
ContentResolver
.getContent(key + ".properties")ContentResolver.getContent(String key)
to an Object.key
- The Key of the byte[] who should be converted to an Object.contentResolver
- The contentResolver, from where the content could be read.void addObjectResolver(ObjectResolver objectResolver)
ObjectResolver
are delegating the functionality
to other ObjectResolvers.UnionObjectResolver
-------------------------------------- <objectResolver name="DefaultObjectResolver" class="org.settings4j.objectresolver.UnionObjectResolver"> <objectResolver-ref ref="JavaXMLBeansObjectResolver" /> <objectResolver-ref ref="SpringConfigObjectResolver" /> </objectResolver> --------------------------------------
objectResolver
- the original objectResolver to delegate.Copyright © 2008–2014. All rights reserved.