// component is the component which contains the element that has the binding
// component definition is the definition of the element that has the binding
int bindingDirection = AWBindingApi.Either;
AWApi componentApi = componentDefinition.componentApi();
if (componentApi != null) {
AWBindingApi bindingApi = componentApi.getBindingApi(bindingName());
if (bindingApi != null) {
// catch in case they failed to specify a "direction" on their <binding> tag
try {
bindingDirection = bindingApi.direction();
} catch (RuntimeException runtimeException) {
componentDefinition.addInvalidValueForBinding(validationContext, component, "direction", "binding tag: missing or invalid 'direction' attribute");
}
}