Search in sources :

Example 1 with ViewResolutionErrors

use of org.robobinding.ViewResolutionErrors in project RoboBinding by RoboBinding.

the class BindingViewInflaterTest method emptyViewResolutionResult.

private ViewResolutionResult emptyViewResolutionResult() {
    ResolvedBindingAttributesForView viewBindingAttributes = mock(ResolvedBindingAttributesForView.class);
    ViewResolutionErrors errors = mock(ViewResolutionErrors.class);
    return new ViewResolutionResult(viewBindingAttributes, errors);
}
Also used : ViewResolutionErrors(org.robobinding.ViewResolutionErrors)

Example 2 with ViewResolutionErrors

use of org.robobinding.ViewResolutionErrors in project RoboBinding by RoboBinding.

the class BindingAttributeResolver method resolve.

public ViewResolutionResult resolve(PendingAttributesForView pendingAttributesForView) {
    List<ViewAttributeBinder> resolvedViewAttributes = Lists.newArrayList();
    Iterable<ByBindingAttributeMappingsResolver> resolvers = byBindingAttributeMappingsResolverFinder.findCandidates(pendingAttributesForView.getView());
    for (ByBindingAttributeMappingsResolver resolver : resolvers) {
        Collection<ViewAttributeBinder> newResolvedViewAttributes = resolver.resolve(pendingAttributesForView);
        resolvedViewAttributes.addAll(newResolvedViewAttributes);
        if (pendingAttributesForView.isEmpty())
            break;
    }
    ViewResolutionErrors errors = pendingAttributesForView.getResolutionErrors();
    ResolvedBindingAttributesForView resolvedBindingAttributes = new ResolvedBindingAttributesForView(pendingAttributesForView.getView(), resolvedViewAttributes);
    return new ViewResolutionResult(resolvedBindingAttributes, errors);
}
Also used : ViewResolutionErrors(org.robobinding.ViewResolutionErrors) ViewAttributeBinder(org.robobinding.viewattribute.ViewAttributeBinder)

Aggregations

ViewResolutionErrors (org.robobinding.ViewResolutionErrors)2 ViewAttributeBinder (org.robobinding.viewattribute.ViewAttributeBinder)1