@Test(expected = ObjectRetrievalException.class) public void testGetObjectFromNameClassPairObjectRetrievalException() { Binding expectedBinding = new Binding("some name", null); replay(mapperMock); tested.getObjectFromNameClassPair(expectedBinding); verify(mapperMock); }
public Object getObjectFromNameClassPair(final NameClassPair nameClassPair) { if (!(nameClassPair instanceof Binding)) { throw new IllegalArgumentException("Parameter must be an instance of Binding"); } Binding binding = (Binding) nameClassPair; Object object = binding.getObject(); if (object == null) { throw new ObjectRetrievalException("Binding did not contain any object."); } Object result = null; if (nameClassPair instanceof HasControls) { result = mapper.mapFromContextWithControls(object, (HasControls) nameClassPair); } else { result = mapper.mapFromContext(object); } return result; }
ContextMapperCallbackHandlerWithControls extends ContextMapperCallbackHandler { public Object getObjectFromNameClassPair(final NameClassPair nameClassPair) { if (!(nameClassPair instanceof Binding)) { throw new IllegalArgumentException("Parameter must be an instance of Binding"); } Binding binding = (Binding) nameClassPair; Object object = binding.getObject(); if (object == null) { throw new ObjectRetrievalException("Binding did not contain any object."); } Object result = null; if (nameClassPair instanceof HasControls) { result = mapper.mapFromContextWithControls(object, (HasControls) nameClassPair); } else { result = mapper.mapFromContext(object); } return result; } }
ContextMapperCallbackHandlerWithControls extends ContextMapperCallbackHandler { public Object getObjectFromNameClassPair(final NameClassPair nameClassPair) { if (!(nameClassPair instanceof Binding)) { throw new IllegalArgumentException("Parameter must be an instance of Binding"); } Binding binding = (Binding) nameClassPair; Object object = binding.getObject(); if (object == null) { throw new ObjectRetrievalException("Binding did not contain any object."); } Object result = null; if (nameClassPair instanceof HasControls) { result = mapper.mapFromContextWithControls(object, (HasControls) nameClassPair); } else { result = mapper.mapFromContext(object); } return result; } ContextMapperCallbackHandlerWithControls(final ParameterizedContextMapperWithControls<?> mapper); }
ContextMapperCallbackHandlerWithControls extends ContextMapperCallbackHandler { public Object getObjectFromNameClassPair(final NameClassPair nameClassPair) { if (!(nameClassPair instanceof Binding)) { throw new IllegalArgumentException("Parameter must be an instance of Binding"); } Binding binding = (Binding) nameClassPair; Object object = binding.getObject(); if (object == null) { throw new ObjectRetrievalException("Binding did not contain any object."); } Object result = null; if (nameClassPair instanceof HasControls) { result = mapper.mapFromContextWithControls(object, (HasControls) nameClassPair); } else { result = mapper.mapFromContext(object); } return result; } ContextMapperCallbackHandlerWithControls(final ParameterizedContextMapperWithControls<?> mapper); Object getObjectFromNameClassPair(final NameClassPair nameClassPair); }
ContextMapperCallbackHandlerWithControls extends ContextMapperCallbackHandler { public Object getObjectFromNameClassPair(final NameClassPair nameClassPair) { if (!(nameClassPair instanceof Binding)) { throw new IllegalArgumentException("Parameter must be an instance of Binding"); } Binding binding = (Binding) nameClassPair; Object object = binding.getObject(); if (object == null) { throw new ObjectRetrievalException("Binding did not contain any object."); } Object result = null; if (nameClassPair instanceof HasControls) { result = mapper.mapFromContextWithControls(object, (HasControls) nameClassPair); } else { result = mapper.mapFromContext(object); } return result; } ContextMapperCallbackHandlerWithControls(final ParameterizedContextMapperWithControls<?> mapper); Object getObjectFromNameClassPair(final NameClassPair nameClassPair);  }