@Test public void testCreateDispatcherChain_NullModelObject() { PmoWithNullModelObject pmoWithNullModelObject = new PmoWithNullModelObject(); PropertyDispatcher defaultDispatcher = propertyDispatcherFactory .createDispatcherChain(pmoWithNullModelObject, BoundProperty.of("foo").withModelAttribute(TestModelObject.PROPERTY_MODEL_PROP), PropertyBehaviorProvider.NO_BEHAVIOR_PROVIDER); IllegalStateException illegalStateException = assertThrows(IllegalStateException.class, () -> defaultDispatcher.pull(Aspect.of(""))); assertThat(illegalStateException.getMessage(), containsStringIgnoringCase("object must not be null")); }
public PropertyDispatcher createDispatcherChain(Object pmo, BoundProperty boundProperty, PropertyBehaviorProvider behaviorProvider) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(boundProperty, "boundProperty must not be null"); requireNonNull(behaviorProvider, "behaviorProvider must not be null"); String modelPropertyName = boundProperty.getModelAttribute(); String modelObjectName = boundProperty.getModelObject(); String pmoPropertyName = boundProperty.getPmoProperty(); ExceptionPropertyDispatcher exceptionDispatcher = newExceptionDispatcher(pmo, modelObjectName, pmoPropertyName); ReflectionPropertyDispatcher reflectionDispatcher = newReflectionDispatcher(pmo, pmoPropertyName, modelObjectName, modelPropertyName, exceptionDispatcher); StaticValueDispatcher bindingAnnotationDispatcher = new StaticValueDispatcher(reflectionDispatcher); PropertyDispatcher customDispatchers = createCustomDispatchers(pmo, boundProperty, bindingAnnotationDispatcher); return new BehaviorDependentDispatcher(customDispatchers, behaviorProvider); }
PropertyDispatcherFactory { public PropertyDispatcher createDispatcherChain(Object pmo, BoundProperty boundProperty, PropertyBehaviorProvider behaviorProvider) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(boundProperty, "boundProperty must not be null"); requireNonNull(behaviorProvider, "behaviorProvider must not be null"); String modelPropertyName = boundProperty.getModelAttribute(); String modelObjectName = boundProperty.getModelObject(); String pmoPropertyName = boundProperty.getPmoProperty(); ExceptionPropertyDispatcher exceptionDispatcher = newExceptionDispatcher(pmo, modelObjectName, pmoPropertyName); ReflectionPropertyDispatcher reflectionDispatcher = newReflectionDispatcher(pmo, pmoPropertyName, modelObjectName, modelPropertyName, exceptionDispatcher); StaticValueDispatcher bindingAnnotationDispatcher = new StaticValueDispatcher(reflectionDispatcher); PropertyDispatcher customDispatchers = createCustomDispatchers(pmo, boundProperty, bindingAnnotationDispatcher); return new BehaviorDependentDispatcher(customDispatchers, behaviorProvider); } }
PropertyDispatcherFactory { public PropertyDispatcher createDispatcherChain(Object pmo, BoundProperty boundProperty, PropertyBehaviorProvider behaviorProvider) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(boundProperty, "boundProperty must not be null"); requireNonNull(behaviorProvider, "behaviorProvider must not be null"); String modelPropertyName = boundProperty.getModelAttribute(); String modelObjectName = boundProperty.getModelObject(); String pmoPropertyName = boundProperty.getPmoProperty(); ExceptionPropertyDispatcher exceptionDispatcher = newExceptionDispatcher(pmo, modelObjectName, pmoPropertyName); ReflectionPropertyDispatcher reflectionDispatcher = newReflectionDispatcher(pmo, pmoPropertyName, modelObjectName, modelPropertyName, exceptionDispatcher); StaticValueDispatcher bindingAnnotationDispatcher = new StaticValueDispatcher(reflectionDispatcher); PropertyDispatcher customDispatchers = createCustomDispatchers(pmo, boundProperty, bindingAnnotationDispatcher); return new BehaviorDependentDispatcher(customDispatchers, behaviorProvider); }  }
PropertyDispatcherFactory { public PropertyDispatcher createDispatcherChain(Object pmo, BoundProperty boundProperty, PropertyBehaviorProvider behaviorProvider) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(boundProperty, "boundProperty must not be null"); requireNonNull(behaviorProvider, "behaviorProvider must not be null"); String modelPropertyName = boundProperty.getModelAttribute(); String modelObjectName = boundProperty.getModelObject(); String pmoPropertyName = boundProperty.getPmoProperty(); ExceptionPropertyDispatcher exceptionDispatcher = newExceptionDispatcher(pmo, modelObjectName, pmoPropertyName); ReflectionPropertyDispatcher reflectionDispatcher = newReflectionDispatcher(pmo, pmoPropertyName, modelObjectName, modelPropertyName, exceptionDispatcher); StaticValueDispatcher bindingAnnotationDispatcher = new StaticValueDispatcher(reflectionDispatcher); PropertyDispatcher customDispatchers = createCustomDispatchers(pmo, boundProperty, bindingAnnotationDispatcher); return new BehaviorDependentDispatcher(customDispatchers, behaviorProvider); }  PropertyDispatcher createDispatcherChain(Object pmo,
            BoundProperty boundProperty,
            PropertyBehaviorProvider behaviorProvider); }
PropertyDispatcherFactory { public PropertyDispatcher createDispatcherChain(Object pmo, BoundProperty boundProperty, PropertyBehaviorProvider behaviorProvider) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(boundProperty, "boundProperty must not be null"); requireNonNull(behaviorProvider, "behaviorProvider must not be null"); String modelPropertyName = boundProperty.getModelAttribute(); String modelObjectName = boundProperty.getModelObject(); String pmoPropertyName = boundProperty.getPmoProperty(); ExceptionPropertyDispatcher exceptionDispatcher = newExceptionDispatcher(pmo, modelObjectName, pmoPropertyName); ReflectionPropertyDispatcher reflectionDispatcher = newReflectionDispatcher(pmo, pmoPropertyName, modelObjectName, modelPropertyName, exceptionDispatcher); StaticValueDispatcher bindingAnnotationDispatcher = new StaticValueDispatcher(reflectionDispatcher); PropertyDispatcher customDispatchers = createCustomDispatchers(pmo, boundProperty, bindingAnnotationDispatcher); return new BehaviorDependentDispatcher(customDispatchers, behaviorProvider); }  PropertyDispatcher createDispatcherChain(Object pmo,
            BoundProperty boundProperty,
            PropertyBehaviorProvider behaviorProvider);  }