Package com.palantir.ptoss.cinch.core
Class BindingContext
java.lang.Object
com.palantir.ptoss.cinch.core.BindingContext
 A BindingContext holds information about how to bind various parts of a Java Object.
 
Binding Constants - TODO
Visibility - TODO
Subclassing - TODO
Bindable models - have to be final
- 
Constructor SummaryConstructorsConstructorDescriptionBindingContext(Object object) Create a BindingContext for the given, non-null object.
- 
Method SummaryModifier and TypeMethodDescriptionevalOnObject(String on, BindableModel model) findGetter(String property) findModelUpdateClass(BindableModel modelClass) Returns the list ofModelUpdatetypes in this binding context.static ModelUpdatefindOnObject(String on, BindableModel model) Resolves a string reference, as specified in theonparameter of aBoundannotation to an Enum object in this runtime.findSetter(String property) getAnnotatedFields(Class<? extends Annotation> klass) getAnnotatedParameterlessMethods(Class<? extends Annotation> annotation) Gets a constant from the binding context.getBindableMethod(String key) Looks up anObjectFieldMethodtuple by its key.getBindableModel(String key) Looks up anObjectFieldMethodtuple by its key.<T> TgetFieldObject(Field field, Class<T> klass) Returns the value of the specified Field on the object bound by thisBindingContextgetOnObjects(String[] ons, BindableModel model) static <T extends Enum<?> & ModelUpdate>
 booleanstatic <T extends Enum<?> & ModelUpdate>
 booleanisOn(Collection<Object> ons, T... changed) 
- 
Constructor Details- 
BindingContextCreate a BindingContext for the given, non-null object. Throws aBindingExceptionif there is a problem.- Parameters:
- object- the object - cannot be null
 
 
- 
- 
Method Details- 
getBindableConstantGets a constant from the binding context. Constants are static, final fields of the bound object.- Parameters:
- key- the name of the field
- Returns:
- the value of the field
 
- 
getFieldObjectReturns the value of the specified Field on the object bound by thisBindingContext- Parameters:
- field-- Fieldto pull the value from
- klass- return type of value in the- Field
- Returns:
- value of type klassfrom fieldfieldon bound object.
- Throws:
- IllegalArgumentException- if the passed- Fieldis not a field on the object bound by this- BindingContext
 
- 
getBindableMethodLooks up anObjectFieldMethodtuple by its key.- Parameters:
- key- - generated by- OnChange.call()
- Returns:
- the tuple for this key (or null, if it doesn't exist)
 
- 
getBindableModelMethodLooks up anObjectFieldMethodtuple by its key.- Parameters:
- key- - generated by- OnChange.call()
- Returns:
- the tuple for this key (or null, if it doesn't exist)
 
- 
getBindableModel
- 
evalOnObject
- 
findModelUpdateClassReturns the list ofModelUpdatetypes in this binding context.- Returns:
- the of Classes that implementModelUpdatein this binding context.
 
- 
findOnObjectResolves a string reference, as specified in theonparameter of aBoundannotation to an Enum object in this runtime.- Parameters:
- on-- onparameter from a- Boundannotation.
- Returns:
- the resolved object
- Throws:
- IllegalArgumentException- if the referenced object can't be found.
 
- 
findGetter
- 
findSetter
- 
getBindableModels
- 
getAnnotatedFields
- 
getAnnotatedParameterlessMethodspublic List<ObjectFieldMethod> getAnnotatedParameterlessMethods(Class<? extends Annotation> annotation) 
- 
isOn
- 
isOn
- 
getOnObjects
 
-