List of usage examples for org.springframework.aop.framework ProxyFactory setOpaque
public void setOpaque(boolean opaque)
From source file:org.springframework.data.rest.core.projection.ProxyProjectionFactory.java
@Override @SuppressWarnings("unchecked") public <T> T createProjection(Object source, Class<T> projectionType) { Assert.isTrue(projectionType.isInterface(), "Projection type must be an interface!"); if (source == null) { return null; }/*from w w w . j av a2 s . c o m*/ ProxyFactory factory = new ProxyFactory(); factory.setTarget(source); factory.setOpaque(true); factory.setInterfaces(projectionType, TargetClassAware.class); factory.addAdvice(new TargetClassAwareMethodInterceptor(source.getClass())); factory.addAdvice(getMethodInterceptor(source, projectionType)); return (T) factory.getProxy(); }