/** * Create a BindingContext for the given, non-null object. Throws a {@link BindingException} * if there is a problem. * @param object the object - cannot be null */ public BindingContext(Object object) { Preconditions.checkNotNull(object, "object"); this.object = object; try { bindableModels = indexBindableModels(); bindableMethods = indexBindableMethods(); bindableModelMethods = indexBindableModelMethods(); bindableConstants = indexBindableConstants(); bindableGetters = indexBindableProperties(Reflections.getterFunction(PropertyDescriptor.class, Method.class, "readMethod")); bindableSetters = indexBindableProperties(Reflections.getterFunction(PropertyDescriptor.class, Method.class, "writeMethod")); } catch (Exception e) { throw new BindingException("could not create BindingContext", e); } }