* @see de.odysseus.calyxo.base.conf.FieldConfig#get(java.lang.Class, java.lang.Object)
*/
public Object get(Class clazz, Object object) throws ConfigException {
if (clazz == null) {
if (object == null) {
throw new ConfigException("Cannot get field from null in " + toInlineString());
}
clazz = object.getClass();
} else if (object != null && !clazz.isInstance(object)) {
throw new ConfigException("Specified object is not an instance of " + clazz.getName() + " in " + toInlineString());
}
try {
return clazz.getField(name).get(object);
} catch (Exception e) {
throw new ConfigException("Could not access field in " + toInlineString(), e);
}
}