@SuppressWarnings("unchecked") @Test public void testGetProperty() throws OgnlException { NestedObjectExtractor<Integer> nestedObjectExtractor = createMock(NestedObjectExtractor.class); PropertyAccessor propertyAccessor = createMock(PropertyAccessor.class); Map<String, Object> context = createMock(Map.class); expect(propertyAccessor.getProperty(context, "nested", "property")).andReturn("value"); expect(nestedObjectExtractor.getNestedObject(1)).andReturn("nested"); replay(nestedObjectExtractor, propertyAccessor, context); PropertyAccessor accessor = new NestedObjectDelegatePropertyAccessor<Integer>( nestedObjectExtractor, propertyAccessor); assertEquals("value", accessor.getProperty(context, 1, "property")); verify(nestedObjectExtractor, propertyAccessor, context); }
@SuppressWarnings("unchecked") public Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name) throws OgnlException { return propertyAccessor.getProperty(context, nestedObjectExtractor .getNestedObject((T) target), name); }
NestedObjectDelegatePropertyAccessor implements
        PropertyAccessor { @SuppressWarnings("unchecked") public Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name) throws OgnlException { return propertyAccessor.getProperty(context, nestedObjectExtractor .getNestedObject((T) target), name); } }
NestedObjectDelegatePropertyAccessor implements
        PropertyAccessor { @SuppressWarnings("unchecked") public Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name) throws OgnlException { return propertyAccessor.getProperty(context, nestedObjectExtractor .getNestedObject((T) target), name); } NestedObjectDelegatePropertyAccessor(
            NestedObjectExtractor<T> nestedObjectExtractor,
            PropertyAccessor propertyAccessor); }
NestedObjectDelegatePropertyAccessor implements
        PropertyAccessor { @SuppressWarnings("unchecked") public Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name) throws OgnlException { return propertyAccessor.getProperty(context, nestedObjectExtractor .getNestedObject((T) target), name); } NestedObjectDelegatePropertyAccessor(
            NestedObjectExtractor<T> nestedObjectExtractor,
            PropertyAccessor propertyAccessor); @SuppressWarnings("unchecked") Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name); @SuppressWarnings("unchecked") void setProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name,
            Object value); @SuppressWarnings("unchecked") String getSourceAccessor(OgnlContext context, Object target,
            Object index); @SuppressWarnings("unchecked") String getSourceSetter(OgnlContext context, Object target,
            Object index); }
NestedObjectDelegatePropertyAccessor implements
        PropertyAccessor { @SuppressWarnings("unchecked") public Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name) throws OgnlException { return propertyAccessor.getProperty(context, nestedObjectExtractor .getNestedObject((T) target), name); } NestedObjectDelegatePropertyAccessor(
            NestedObjectExtractor<T> nestedObjectExtractor,
            PropertyAccessor propertyAccessor); @SuppressWarnings("unchecked") Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name); @SuppressWarnings("unchecked") void setProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name,
            Object value); @SuppressWarnings("unchecked") String getSourceAccessor(OgnlContext context, Object target,
            Object index); @SuppressWarnings("unchecked") String getSourceSetter(OgnlContext context, Object target,
            Object index);  }