@Test(expected = ObjectRetrievalException.class) public void testGetObjectFromNameClassPairObjectRetrievalException() throws NamingException { Binding expectedBinding = new Binding("some name", null); tested.getObjectFromNameClassPair(expectedBinding); }
public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException { 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."); } return mapper.mapFromContext(object); }
ContextMapperCallbackHandler extends
        CollectingNameClassPairCallbackHandler<T> { public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException { 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."); } return mapper.mapFromContext(object); } }
ContextMapperCallbackHandler extends
        CollectingNameClassPairCallbackHandler<T> { public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException { 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."); } return mapper.mapFromContext(object); } ContextMapperCallbackHandler(ContextMapper<T> mapper); }
ContextMapperCallbackHandler extends
        CollectingNameClassPairCallbackHandler<T> { public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException { 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."); } return mapper.mapFromContext(object); } ContextMapperCallbackHandler(ContextMapper<T> mapper); T getObjectFromNameClassPair(NameClassPair nameClassPair); }
ContextMapperCallbackHandler extends
        CollectingNameClassPairCallbackHandler<T> { public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException { 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."); } return mapper.mapFromContext(object); } ContextMapperCallbackHandler(ContextMapper<T> mapper); T getObjectFromNameClassPair(NameClassPair nameClassPair);  }