Example usage for org.apache.wicket.proxy IProxyTargetLocator IProxyTargetLocator

List of usage examples for org.apache.wicket.proxy IProxyTargetLocator IProxyTargetLocator

Introduction

In this page you can find the example usage for org.apache.wicket.proxy IProxyTargetLocator IProxyTargetLocator.

Prototype

IProxyTargetLocator

Source Link

Usage

From source file:com.ttdev.wicketpagetest.MockedBeanFieldValueFactory.java

License:Open Source License

public Object getFieldValue(Field field, Object fieldOwner) {
    final String fieldName = field.getName();
    if (!hasValueForField(fieldName)) {
        return null;
    }//from  w  ww  .j a  v a  2 s . c  o  m
    return LazyInitProxyFactory.createProxy(field.getType(), new IProxyTargetLocator() {

        private static final long serialVersionUID = 1L;

        public Object locateProxyTarget() {
            return mockedBeans.get(fieldName);
        }
    });
}