org.neo4j.kernel
Class ConfigProxy
java.lang.Object
org.neo4j.kernel.ConfigProxy
- All Implemented Interfaces:
- InvocationHandler
public class ConfigProxy
- extends Object
- implements InvocationHandler
This class is used to create dynamic proxies that implement a configuration interface. Method calls are mapped to
a backing Map with String settings. If the return type is not a string, conversion is attempted. If the setting
does not exist, or the conversion fails, a default can be supplied as the first method argument. Example:
boolean read_only(boolean def) -> lookup "read_only" in map and return def if not found
For numbers, max and min values can be specified as follows:
float someValue(float def, float min, float max)
If no default is supplied, then failure to look up value, or failure to convert it, will cause exceptions. Please
provide defaults as often as possible to avoid this.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConfigProxy
public ConfigProxy(Map<String,String> parameters)
config
public static <T> T config(Map<String,String> parameters,
Class<T> configInterface)
map
public static Map<String,String> map(Object configuration)
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Specified by:
invoke
in interface InvocationHandler
- Throws:
Throwable
Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.