List of usage examples for org.apache.wicket.util.lang Objects convertValue
public static <T> T convertValue(final Object value, final Class<T> toType)
From source file:org.wicketstuff.lazymodel.reflect.Evaluation.java
License:Apache License
/** * Create a proxy for the current type.// w w w .j av a 2 s .c o m * <p> * If the result cannot be proxied, it is accessible via * {@link #lastNonProxyable}. * * @return proxy or {@code null} if invocation result cannot be proxied */ @SuppressWarnings("unchecked") public Object proxy() { Class clazz = Reflection.getClass(type); if (clazz.isPrimitive()) { lastNonProxyable.set(this); return Objects.convertValue(null, clazz); } Class proxyClass = proxyFactory.createClass(clazz); if (proxyClass == null) { lastNonProxyable.set(this); return null; } return clazz.cast(proxyFactory.createInstance(proxyClass, this)); }