@Override public Object invoke( Object o, final Method method, Object[] objects ) throws Throwable { if( method.equals( NamedAssociation.class.getMethod( "get", String.class ) ) ) { Type namedAssociationType = GenericAssociationInfo.associationTypeOf( namedAssociation.accessor() ); if( namedAssociationType.getClass().equals( Class.class ) ) { return Proxy.newProxyInstance( method.getDeclaringClass().getClassLoader(), array( (Class) namedAssociationType, PropertyReference.class ), new TemplateHandler<T>( null, null, null, namedAssociation ) ); } } return null; } }
@Override public Object invoke( Object o, final Method method, Object[] objects ) throws Throwable { if( method.equals( NamedAssociation.class.getMethod( "get", String.class ) ) ) { Type namedAssociationType = GenericAssociationInfo.associationTypeOf( namedAssociation.accessor() ); if( namedAssociationType.getClass().equals( Class.class ) ) { return Proxy.newProxyInstance( method.getDeclaringClass().getClassLoader(), array( (Class) namedAssociationType, PropertyReference.class ), new TemplateHandler<T>( null, null, null, namedAssociation ) ); } } return null; } }